Skip to content

Commit

Permalink
fix(*): linting
Browse files Browse the repository at this point in the history
  • Loading branch information
zekth authored and GGabriele committed Mar 24, 2023
1 parent 0d80472 commit 3184491
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 92 deletions.
2 changes: 1 addition & 1 deletion cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func fetchKongVersion(ctx context.Context, config utils.KongClientConfig) (strin
return version, nil
}

func validateNoArgs(cmd *cobra.Command, args []string) error {
func validateNoArgs(_ *cobra.Command, args []string) error {
if len(args) > 0 {
return fmt.Errorf("positional arguments are not valid for this command, " +
"please use flags instead")
Expand Down
6 changes: 3 additions & 3 deletions crud/registry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ func (t testActionFixture) invoke(op string, inputs ...Arg) (Arg, error) {
return res, nil
}

func (t testActionFixture) Create(ctx context.Context, input ...Arg) (Arg, error) {
func (t testActionFixture) Create(_ context.Context, input ...Arg) (Arg, error) {
return t.invoke("create", input...)
}

func (t testActionFixture) Delete(ctx context.Context, input ...Arg) (Arg, error) {
func (t testActionFixture) Delete(_ context.Context, input ...Arg) (Arg, error) {
return t.invoke("delete", input...)
}

func (t testActionFixture) Update(ctx context.Context, input ...Arg) (Arg, error) {
func (t testActionFixture) Update(_ context.Context, input ...Arg) (Arg, error) {
return t.invoke("update", input...)
}

Expand Down
7 changes: 2 additions & 5 deletions docs/generate-docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@ func genMarkdownTreeCustom(cmd *cobra.Command, dir string, filePrepender, linkHa
if _, err := io.WriteString(f, filePrepender(filename)); err != nil {
return err
}
if err := genMarkdownCustom(cmd, f, linkHandler); err != nil {
return err
}
return nil
return genMarkdownCustom(cmd, f, linkHandler)
}

func flagUsagesWrapped(f *pflag.FlagSet) string {
Expand All @@ -59,7 +56,7 @@ func flagUsagesWrapped(f *pflag.FlagSet) string {
if flag.Hidden {
return
}
line := ""
var line string
if flag.Shorthand != "" && flag.ShorthandDeprecated == "" {
line = fmt.Sprintf("`-%s`, `--%s`\n:", flag.Shorthand, flag.Name)
} else {
Expand Down
6 changes: 3 additions & 3 deletions state/konnect_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func (d1 *Document) Equal(d2 *Document) bool {
// If ignoreID is set to true, IDs will be ignored while comparison.
// If ignoreTS is set to true, timestamp fields will be ignored.
func (d1 *Document) EqualWithOpts(d2 *Document,
ignoreID, ignoreTS, ignoreForeign bool,
ignoreID, _, ignoreForeign bool,
) bool {
d1Copy := d1.Document.ShallowCopy()
d2Copy := d2.Document.ShallowCopy()
Expand Down Expand Up @@ -81,7 +81,7 @@ func (s1 *ServicePackage) Equal(s2 *ServicePackage) bool {
// If ignoreID is set to true, IDs will be ignored while comparison.
// If ignoreTS is set to true, timestamp fields will be ignored.
func (s1 *ServicePackage) EqualWithOpts(s2 *ServicePackage,
ignoreID bool, ignoreTS bool,
ignoreID bool, _ bool,
) bool {
s1Copy := s1.ServicePackage.DeepCopy()
s2Copy := s2.ServicePackage.DeepCopy()
Expand Down Expand Up @@ -124,7 +124,7 @@ func (s1 *ServiceVersion) Equal(s2 *ServiceVersion) bool {
// If ignoreID is set to true, IDs will be ignored while comparison.
// If ignoreTS is set to true, timestamp fields will be ignored.
func (s1 *ServiceVersion) EqualWithOpts(s2 *ServiceVersion,
ignoreID, ignoreTS, ignoreForeign bool,
ignoreID, _, ignoreForeign bool,
) bool {
s1Copy := s1.ServiceVersion.DeepCopy()
s2Copy := s2.ServiceVersion.DeepCopy()
Expand Down
4 changes: 2 additions & 2 deletions state/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ func (r1 *RBACRole) Equal(r2 *RBACRole) bool {
// If ignoreID is set to true, IDs will be ignored while comparison.
// If ignoreTS is set to true, timestamp fields will be ignored.
func (r1 *RBACRole) EqualWithOpts(r2 *RBACRole, ignoreID,
ignoreTS, ignoreForeign bool,
ignoreTS, _ bool,
) bool {
r1Copy := r1.RBACRole.DeepCopy()
r2Copy := r2.RBACRole.DeepCopy()
Expand Down Expand Up @@ -1377,7 +1377,7 @@ func (r1 *RBACEndpointPermission) Equal(r2 *RBACEndpointPermission) bool {
// If ignoreID is set to true, IDs will be ignored while comparison.
// If ignoreTS is set to true, timestamp fields will be ignored.
func (r1 *RBACEndpointPermission) EqualWithOpts(r2 *RBACEndpointPermission, ignoreID,
ignoreTS, ignoreForeign bool,
ignoreTS, _ bool,
) bool {
r1Copy := r1.RBACEndpointPermission.DeepCopy()
r2Copy := r2.RBACEndpointPermission.DeepCopy()
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func readFile(filepath string) (string, error) {
return string(content), nil
}

func setup(t *testing.T) func(t *testing.T) {
func setup(_ *testing.T) func(t *testing.T) {
// disable analytics for integration tests
os.Setenv("DECK_ANALYTICS", "off")
return func(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion types/consumer_group_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ type consumerGroupPluginDiffer struct {
currentState, targetState *state.KongState
}

func (d *consumerGroupPluginDiffer) Deletes(handler func(crud.Event) error) error {
func (d *consumerGroupPluginDiffer) Deletes(_ func(crud.Event) error) error {
return nil
}

Expand Down
Loading

0 comments on commit 3184491

Please sign in to comment.