Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency Bumps & Use golang 1.22/1.23 in CI & Fix linter issues #221

Merged
merged 6 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/compatibility_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.23
id: go

- name: Setup dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
strategy:
matrix:
go:
- 18
- 19
- 22
- 23
name: Test-1.${{ matrix.go }}.x
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.23
id: go

- name: go cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.23
id: go

- name: Check out code into the Go module directory
Expand Down
5 changes: 3 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ linters:
disable-all: true
enable:
- bodyclose
- depguard
- dogsled
- dupl
- errcheck
Expand Down Expand Up @@ -80,6 +79,7 @@ linters:

# don't enable:
# - asciicheck
# - depguard
# - exhaustive
# - gochecknoinits
# - gochecknoglobals
Expand All @@ -104,6 +104,7 @@ issues:
- 'declaration of "(err|ctx)" shadows declaration at'
- 'unnamedResult: consider giving a name to these results'
- '(Expect directory permissions to be 0750 or less|Expect (WriteFile|file) permissions to be 0600 or less)'
- 'dot-imports: should not use dot imports'

exclude-rules:
- path: _test\.go
Expand Down Expand Up @@ -164,4 +165,4 @@ run:
# golangci.com configuration
# https://github.com/golangci/golangci/wiki/Configuration
service:
golangci-lint-version: 1.46.0 # use the fixed version to not introduce new linters unexpectedly
golangci-lint-version: 1.63.3 # use the fixed version to not introduce new linters unexpectedly
2 changes: 1 addition & 1 deletion component/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ func (obw *objectwriter) SetKeys(_ ...string) {
}

// MarkDynamicKeys marks the headers as dynamic
func (obw *objectwriter) MarkDynamicKeys(dynamicKeys ...string) {
func (obw *objectwriter) MarkDynamicKeys(_ ...string) {
// Object writer does not have the concept of dynamic keys
fmt.Fprintln(obw.out, "Programming error, attempt to mark dynamic headers to object output")
}
Expand Down
11 changes: 4 additions & 7 deletions config/certs.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,8 @@ func DeleteCert(host string) error {
if err != nil {
return err
}
err = removeCert(node, host)
if err != nil {
return err
}
removeCert(node, host)

return persistConfig(node)
}

Expand Down Expand Up @@ -187,14 +185,14 @@ func setCert(node *yaml.Node, cert *configtypes.Cert) (persist bool, err error)
return persist, err
}

func removeCert(node *yaml.Node, host string) error {
func removeCert(node *yaml.Node, host string) {
// Find the certs node in the yaml node
keys := []nodeutils.Key{
{Name: KeyCerts},
}
certsNode := nodeutils.FindNode(node.Content[0], nodeutils.WithKeys(keys))
if certsNode == nil {
return nil
return
}
var certs []*yaml.Node
for _, certNode := range certsNode.Content {
Expand All @@ -204,5 +202,4 @@ func removeCert(node *yaml.Node, host string) error {
certs = append(certs, certNode)
}
certsNode.Content = certs
return nil
}
14 changes: 5 additions & 9 deletions config/cli_options_telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ func DeleteTelemetryOptions() error {
return err
}

err = deleteTelemetryOptionsNode(node)
if err != nil {
return err
}
deleteTelemetryOptionsNode(node)

return persistConfig(node)
}

Expand Down Expand Up @@ -115,21 +113,19 @@ func setCLITelemetryOptions(node *yaml.Node, telemetryOptions *configtypes.Telem

// deleteTelemetryOptionsNode removes the telemetry options in the configuration
// Pre-reqs: node != nil
func deleteTelemetryOptionsNode(node *yaml.Node) error {
func deleteTelemetryOptionsNode(node *yaml.Node) {
// Find the telemetry node from the root node
keys := []nodeutils.Key{
{Name: KeyCLI, Type: yaml.MappingNode},
}
cliOptionsNode := nodeutils.FindNode(node.Content[0], nodeutils.WithKeys(keys))
if cliOptionsNode == nil {
return nil
return
}
targetNodeIndex := nodeutils.GetNodeIndex(cliOptionsNode.Content, KeyTelemetry)
if targetNodeIndex == -1 {
return nil
return
}
targetNodeIndex--
cliOptionsNode.Content = append(cliOptionsNode.Content[:targetNodeIndex], cliOptionsNode.Content[targetNodeIndex+2:]...)

return nil
}
2 changes: 1 addition & 1 deletion config/conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func PopulateContexts(cfg *configtypes.ClientConfig) bool {
if s.Name == cfg.CurrentServer {
err := cfg.SetActiveContext(c.ContextType, c.Name)
if err != nil {
log.Warningf(err.Error())
log.Warningf("%s", err.Error())
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion config/legacy_clientconfig_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func clientConfigSetCLI(cfg *configtypes.ClientConfig, node *yaml.Node) (err err

// Deprecated: This method is deprecated
func clientConfigSetCLIRepositories(cfg *configtypes.ClientConfig, node *yaml.Node) error {
if cfg.ClientOptions.CLI.Repositories != nil && len(cfg.ClientOptions.CLI.Repositories) != 0 {
if len(cfg.ClientOptions.CLI.Repositories) != 0 {
err := setCLIRepositories(node, cfg.ClientOptions.CLI.Repositories)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion config/nodeutils/find_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func FindNode(node *yaml.Node, opts ...Options) *yaml.Node {

// getNode parse the yaml node and return the node matched by key
func getNode(node *yaml.Node, key string) *yaml.Node {
if node.Content == nil || len(node.Content) == 0 {
if len(node.Content) == 0 {
return nil
}
nodeIndex := GetNodeIndex(node.Content, key)
Expand Down
22 changes: 11 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/anujc25/tablewriter v0.0.1
github.com/briandowns/spinner v1.19.0
github.com/fatih/color v1.9.0
github.com/google/go-cmp v0.5.9
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.6.0
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/mattn/go-isatty v0.0.11
Expand All @@ -19,12 +19,12 @@ require (
github.com/r3labs/sse/v2 v2.10.0
github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
github.com/tj/assert v0.0.3
github.com/vektah/gqlparser/v2 v2.5.11
github.com/vektah/gqlparser/v2 v2.5.14
go.uber.org/multierr v1.8.0
golang.org/x/mod v0.15.0
golang.org/x/sync v0.6.0
golang.org/x/mod v0.20.0
golang.org/x/sync v0.10.0
gopkg.in/yaml.v3 v3.0.1
)

Expand All @@ -48,12 +48,12 @@ require (
github.com/rivo/uniseg v0.2.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
golang.org/x/net v0.21.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/term v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.18.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/term v0.27.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/tools v0.24.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
48 changes: 22 additions & 26 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI=
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
Expand Down Expand Up @@ -100,47 +98,45 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tj/assert v0.0.3 h1:Df/BlaZ20mq6kuai7f5z2TvPFiwC3xaWJSDQNiIS3Rk=
github.com/tj/assert v0.0.3/go.mod h1:Ne6X72Q+TB1AteidzQncjw9PabbMp4PBMZ1k+vd1Pvk=
github.com/vektah/gqlparser/v2 v2.5.11 h1:JJxLtXIoN7+3x6MBdtIP59TP1RANnY7pXOaDnADQSf8=
github.com/vektah/gqlparser/v2 v2.5.11/go.mod h1:1rCcfwB2ekJofmluGWXMSEnPMZgbxzwj6FaZ/4OT8Cc=
github.com/vektah/gqlparser/v2 v2.5.14 h1:dzLq75BJe03jjQm6n56PdH1oweB8ana42wj7E4jRy70=
github.com/vektah/gqlparser/v2 v2.5.14/go.mod h1:WQQjFc+I1YIzoPvZBhUQX7waZgg3pMLi0r8KymvAE2w=
go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8=
go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8=
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20191116160921-f9c825593386/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ=
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=
golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20210503060354-a79de5458b56/go.mod h1:tfny5GFUkzUvx4ps4ajbZsCe5lw1metzhBm9T3x7oIY=
golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ=
golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/cenkalti/backoff.v1 v1.1.0 h1:Arh75ttbsvlpVA7WtVpH4u9h6Zl46xuptxqLxPiSo4Y=
gopkg.in/cenkalti/backoff.v1 v1.1.0/go.mod h1:J6Vskwqd+OMVJl8C33mmtxTBs2gyzfv7UDAkHu8BrjI=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
8 changes: 0 additions & 8 deletions go.work

This file was deleted.

7 changes: 0 additions & 7 deletions go.work.sum

This file was deleted.

2 changes: 1 addition & 1 deletion hack/tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ BIN_DIR := bin

GOIMPORTS_VERSION=0.1.12
VALE_VERSION=2.20.1
GOLANGCI_LINT_VERSION=1.51.0
GOLANGCI_LINT_VERSION=1.63.3
MISSPELL_VERSION=0.3.4
GINKGO_VERSION=2.9.2

Expand Down
8 changes: 4 additions & 4 deletions log/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func getLogThreshold() int32 {
if reqLogLevelStr != "" {
requestedLogLevel, err := strconv.ParseUint(reqLogLevelStr, 10, 32)
if err == nil {
return int32(requestedLogLevel)
return int32(requestedLogLevel) //nolint:gosec // overflow conversion does not apply
}
fmt.Fprintf(os.Stderr, "invalid value %q for %s\n", reqLogLevelStr, EnvTanzuCLILogLevel)
}
Expand Down Expand Up @@ -145,14 +145,14 @@ func (l *logger) Outputf(format string, args ...interface{}) {
// V returns an InfoLogger value for a specific verbosity level.
func (l *logger) V(level int) LoggerImpl {
nl := l.clone()
nl.level = int32(level)
nl.level = int32(level) //nolint:gosec // overflow conversion does not apply
return nl
}

// WithName adds a new element to the logger's name.
func (l *logger) WithName(name string) LoggerImpl {
nl := l.clone()
if len(l.prefix) > 0 {
if l.prefix != "" {
nl.prefix = l.prefix + "/"
}
nl.prefix += name
Expand Down Expand Up @@ -184,7 +184,7 @@ func (l *logger) Clone() LoggerImpl {
func (l *logger) CloneWithLevel(level int) LoggerImpl {
return &logger{
threshold: l.threshold,
level: int32(level),
level: int32(level), //nolint:gosec // overflow conversion does not apply
prefix: l.prefix,
values: copySlice(l.values),
callDepth: l.callDepth,
Expand Down
2 changes: 1 addition & 1 deletion plugin/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func newDescribeCmd(description string) *cobra.Command {
Use: "describe",
Short: "Describes the plugin",
Hidden: true,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
fmt.Println(description)
return nil
},
Expand Down
4 changes: 2 additions & 2 deletions plugin/generate_docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func rebuildTanzuCommandTree(tanzuCmd, pluginRootCmd *cobra.Command, desc *Plugi
}

func getGenDocFn(desc *PluginDescriptor) func(cmd *cobra.Command, args []string) error {
return func(cmd *cobra.Command, args []string) error {
return func(cmd *cobra.Command, _ []string) error {
if docsDir == "" {
docsDir = DefaultDocsDir
}
Expand All @@ -159,7 +159,7 @@ func getGenDocFn(desc *PluginDescriptor) func(cmd *cobra.Command, args []string)
}
return s
}
emptyStr := func(s string) string { return "" }
emptyStr := func(_ string) string { return "" }

tanzuCmd := cobra.Command{
Use: "tanzu",
Expand Down
Loading
Loading