Skip to content

golangci-lint fixes#566

Merged
james-nesbitt merged 1 commit intomainfrom
golang-ci-lint-update
Apr 4, 2025
Merged

golangci-lint fixes#566
james-nesbitt merged 1 commit intomainfrom
golang-ci-lint-update

Conversation

@james-nesbitt
Copy link
Collaborator

  • updated golangci-lint so new fixes show up

@james-nesbitt
Copy link
Collaborator Author

james-nesbitt commented Apr 4, 2025

cmd/describe.go:51:7: QF1001: could apply De Morgan's law (staticcheck)
			if !(ctx.Bool("debug") || ctx.Bool("trace")) {
			  ^
pkg/configurer/windows.go:281:27: QF1008: could remove embedded field "DockerConfigurer" from selector (staticcheck)
			dockerDaemon, err := c.DockerConfigurer.GetDockerDaemonConfig(dockerDaemonString)
			                      ^
pkg/docker/image.go:63:11: QF1001: could apply De Morgan's law (staticcheck)
			return !(strings.Contains(err.Error(), "pull access") || strings.Contains(err.Error(), "manifest unknown"))
			      ^
pkg/helm/upgrade.go:99:45: QF1008: could remove embedded field "ReleaseDetails" from selector (staticcheck)
	release, err := u.RunWithContext(ctx, opts.ReleaseDetails.ReleaseName, chartToUpgrade, opts.Values)
	                                          ^
pkg/kubeclient/kubeclient.go:217:29: QF1008: could remove embedded field "ObjectMeta" from selector (staticcheck)
			if _, ok := storageClass.ObjectMeta.Annotations[constant.DefaultStorageClassAnnotation]; !ok {
			                        ^
pkg/kubeclient/kubeclient.go:220:21: QF1008: could remove embedded field "ObjectMeta" from selector (staticcheck)
				if storageClass.ObjectMeta.Annotations == nil {
				               ^
pkg/kubeclient/kubeclient.go:221:19: QF1008: could remove embedded field "ObjectMeta" from selector (staticcheck)
					storageClass.ObjectMeta.Annotations = make(map[string]string)
					            ^
pkg/kubeclient/kubeclient.go:224:18: QF1008: could remove embedded field "ObjectMeta" from selector (staticcheck)
				storageClass.ObjectMeta.Annotations[constant.DefaultStorageClassAnnotation] = "true"
				            ^
pkg/kubeclient/kubeclient.go:229:29: QF1008: could remove embedded field "ObjectMeta" from selector (staticcheck)
			if _, ok := storageClass.ObjectMeta.Annotations[constant.DefaultStorageClassAnnotation]; ok {
			                        ^
pkg/kubeclient/kubeclient.go:232:25: QF1008: could remove embedded field "ObjectMeta" from selector (staticcheck)
				delete(storageClass.ObjectMeta.Annotations, constant.DefaultStorageClassAnnotation)
				                   ^
pkg/product/mke/api/host.go:240:14: QF1008: could remove embedded field "Connection" from selector (staticcheck)
	if err := h.Connection.Upload(src, dst, fmo); err != nil {
	           ^
pkg/product/mke/api/msr_config.go:112:9: QF1001: could apply De Morgan's law (staticcheck)
	return !(c1.Check(v2) || c2.Check(v2) || c3.Check(v2))
	      ^
pkg/product/mke/exec.go:180:19: QF1008: could remove embedded field "Connection" from selector (staticcheck)
		err := hosts[0].Connection.ExecInteractive("")
		               ^
pkg/product/mke/exec.go:188:22: QF1008: could remove embedded field "Connection" from selector (staticcheck)
		if err := hosts[0].Connection.ExecInteractive(cmd); err != nil {

@james-nesbitt
Copy link
Collaborator Author

helm unit test will still fail, will fix that in another PR

@james-nesbitt james-nesbitt force-pushed the golang-ci-lint-update branch from 4b5c5e7 to 0ee44f4 Compare April 4, 2025 11:28
@james-nesbitt
Copy link
Collaborator Author

passed linging so I will merge it.

- updated golangci-lint so new fixes show up

Signed-off-by: James Nesbitt <jnesbitt@mirantis.com>
@james-nesbitt james-nesbitt force-pushed the golang-ci-lint-update branch from 0ee44f4 to 9336497 Compare April 4, 2025 12:26
@james-nesbitt james-nesbitt merged commit 25c3e41 into main Apr 4, 2025
6 of 7 checks passed
@james-nesbitt james-nesbitt deleted the golang-ci-lint-update branch April 4, 2025 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant