diff --git a/.golangci.yml b/.golangci.yml index 2e0341f0..d75a7f87 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -62,7 +62,7 @@ linters: - gosec # - gosimple - govet - # - ineffassign + - ineffassign - misspell - revive - rowserrcheck diff --git a/internal/cmd/server/ip.go b/internal/cmd/server/ip.go index 4df15ea5..65f58abc 100644 --- a/internal/cmd/server/ip.go +++ b/internal/cmd/server/ip.go @@ -24,7 +24,7 @@ var IPCmd = base.Cmd{ return cmd }, Run: func(s state.State, cmd *cobra.Command, args []string) error { - ipv6, err := cmd.Flags().GetBool("ipv6") + ipv6, _ := cmd.Flags().GetBool("ipv6") idOrName := args[0] server, _, err := s.Client().Server().Get(s, idOrName) if err != nil { diff --git a/internal/cmd/util/util_test.go b/internal/cmd/util/util_test.go index e2758baf..54a402c7 100644 --- a/internal/cmd/util/util_test.go +++ b/internal/cmd/util/util_test.go @@ -378,8 +378,10 @@ func TestParseBoolLenient(t *testing.T) { assert.False(t, b) b, err = util.ParseBoolLenient("invalid") assert.EqualError(t, err, "invalid boolean value: invalid") + assert.False(t, b) b, err = util.ParseBoolLenient("") assert.EqualError(t, err, "invalid boolean value: ") + assert.False(t, b) } func TestBoolFromAny(t *testing.T) {