Skip to content

Conversation

@suzuki-shunsuke
Copy link
Contributor

@suzuki-shunsuke suzuki-shunsuke commented Sep 4, 2025

Close #333

I've confirmed the build succeeded.

go install .

@suzuki-shunsuke suzuki-shunsuke marked this pull request as ready for review September 4, 2025 22:16
@Bobgy
Copy link
Collaborator

Bobgy commented Sep 8, 2025

Can you fix the build failure? It seems it doesn't want go 1.23.0 format.

Maybe we need to upgrade the github actions env to higher go versions first / at the same PR.

@suzuki-shunsuke
Copy link
Contributor Author

I tested this pull request in the following pull request and confirmed CI passed.
I needed to update actions, go, and golangci-lint.

If we upgrade golangci-lint to the latest version, we need to fix code.

https://github.com/suzuki-shunsuke/go-licenses/actions/runs/17544642696/job/49823170134

Details
run golangci-lint
  Running [/home/runner/golangci-lint-2.4.0-linux-amd64/golangci-lint config path] in [/home/runner/work/go-licenses/go-licenses] ...
  Running [/home/runner/golangci-lint-2.4.0-linux-amd64/golangci-lint run] in [/home/runner/work/go-licenses/go-licenses] ...
  Error: e2e_test.go:59:20: Error return value of `os.RemoveAll` is not checked (errcheck)
  	defer os.RemoveAll(tempDir)
  	                  ^
  Error: e2e_test.go:145:20: Error return value of `os.RemoveAll` is not checked (errcheck)
  	defer os.RemoveAll(tempDir)
  	                  ^
  Error: internal/third_party/pkgsite/source/meta-tags.go:57:23: Error return value of `resp.Body.Close` is not checked (errcheck)
  	defer resp.Body.Close()
  	                     ^
  Error: internal/third_party/pkgsite/source/source.go:108:18: Error return value of `resp.Body.Close` is not checked (errcheck)
  		resp.Body.Close()
  		               ^
  Error: internal/third_party/pkgsite/source/source.go:458:17: Error return value of `res.Body.Close` is not checked (errcheck)
  		res.Body.Close()
  		              ^
  Error: internal/third_party/pkgsite/source/source_test.go:48:24: Error return value of `res.Body.Close` is not checked (errcheck)
  			defer res.Body.Close()
  			                    ^
  Error: licenses/classifier.go:58:18: Error return value of `file.Close` is not checked (errcheck)
  	defer file.Close()
  	                ^
  Error: licenses/library_test.go:145:14: Error return value of `os.Setenv` is not checked (errcheck)
  				os.Setenv("GOFLAGS", test.goflags)
  				         ^
  Error: licenses/library_test.go:146:22: Error return value of `os.Unsetenv` is not checked (errcheck)
  				defer os.Unsetenv("GOFLAGS")
  				                 ^
  Error: save.go:85:10: Error return value of `d.Close` is not checked (errcheck)
  		d.Close()
  		       ^
  Error: internal/third_party/pkgsite/derrors/derrors.go:18:2: ST1012: error var NotFound should have name of the form ErrFoo (staticcheck)
  	NotFound = errors.New("not found")
  	^
  Error: internal/third_party/pkgsite/derrors/derrors.go:22:2: ST1012: error var InvalidArgument should have name of the form ErrFoo (staticcheck)
  	InvalidArgument = errors.New("invalid argument")
  	^
  Error: internal/third_party/pkgsite/source/meta-tags.go:94:5: QF1001: could apply De Morgan's law (staticcheck)
  				!(len(importPath) == len(repoRootPrefix) || importPath[len(repoRootPrefix)] == '/') {
  				^
  13 issues:
  * errcheck: 10
  * staticcheck: 3
  
  Error: issues found
  Ran golangci-lint in 21967ms

So I gave up the latest version and updated to v1.64.8

@Bobgy Bobgy force-pushed the chore-golang-tools-0360 branch from f92485d to c12c97a Compare September 8, 2025 10:24
@Bobgy Bobgy merged commit 3e084b0 into google:master Sep 8, 2025
3 checks passed
@github-project-automation github-project-automation bot moved this to Done in main Sep 8, 2025
@Bobgy
Copy link
Collaborator

Bobgy commented Sep 8, 2025

Thanks for the fix! I'm going to release another v2 version with the patch.

@suzuki-shunsuke suzuki-shunsuke deleted the chore-golang-tools-0360 branch September 8, 2025 10:41
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.

Failed to install v2 by go install

2 participants