incubator-devlake icon indicating copy to clipboard operation
incubator-devlake copied to clipboard

[Bug][Backend] Go version inconsistency between go.mod (1.20) and development environment (1.22)

Open spenpal opened this issue 5 months ago • 6 comments

Search before asking

  • [x] I had searched in the issues and found no similar issues.

What happened

The project has inconsistent Go version requirements across different configuration files:

  1. go.mod: Specifies Go 1.20
  2. Development tools in Makefile: Require Go 1.21+ (golangci-lint@latest, mockery v2.43.0, swag v1.16.1)
  3. .devcontainer/Dockerfile: Uses Go 1.22 base image

When trying to run make dep or other Makefile targets with Go 1.20, users get prompted to upgrade to a higher Go version, causing confusion about which version is actually required.

What do you expect to happen

All Go version specifications should be consistent across the project. The go.mod file should reflect the actual minimum Go version required by the development toolchain.

How to reproduce

  1. Install Go 1.20
  2. Clone the repository
  3. Run cd backend && make dep
  4. Observe that development tools request a higher Go version than what's specified in go.mod

Anything else

This inconsistency creates confusion for new contributors and can lead to build failures. The .devcontainer already uses Go 1.22, suggesting this is the intended version.

Suggested fix: Update go.mod to specify Go 1.22 to match the development environment and toolchain requirements.

Version

Latest main branch

Are you willing to submit PR?

  • [ ] Yes I am willing to submit a PR!

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

spenpal avatar Sep 22 '25 15:09 spenpal

Thanks for the report, I have on my backlog to upgrade the GO version of the project in order to reduce some of the problems of building locally that you are also mentioning.

petkostas avatar Sep 22 '25 15:09 petkostas

Adding to this:

Trying to run make go-dev-tools on the backend/ folder is throwing an error is saying it needs >=Golang 1.24 to install. Another Go version inconsistency.

make go-dev-tools
# go install github.com/atombender/go-jsonschema/cmd/gojsonschema@latest
go install golang.org/x/tools/cmd/goimports@latest
go: golang.org/x/tools/cmd/goimports@latest: golang.org/x/[email protected] requires go >= 1.24.0 (running go 1.22.12; GOTOOLCHAIN=local)
make: *** [Makefile:36: go-dev-tools] Error 1

spenpal avatar Sep 30 '25 14:09 spenpal

@spenpal I have made some updates, can you possibly checkout my branch and try them?

petkostas avatar Oct 01 '25 15:10 petkostas

@petkostas Sorry for the late response. I will try tomorrow and let you know.

spenpal avatar Oct 03 '25 04:10 spenpal

This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Dec 03 '25 00:12 github-actions[bot]

Not stale, will pick this up next week.

petkostas avatar Dec 04 '25 17:12 petkostas