Skip to content

fix(docs): correct go install instructions#3309

Merged
kyleconroy merged 1 commit intosqlc-dev:mainfrom
jdahm:patch-1
Apr 4, 2024
Merged

fix(docs): correct go install instructions#3309
kyleconroy merged 1 commit intosqlc-dev:mainfrom
jdahm:patch-1

Conversation

@jdahm
Copy link
Copy Markdown
Contributor

@jdahm jdahm commented Apr 3, 2024

Go 1.21+ is required for recent versions of sqlc. This is because it uses components that require the 1.21 toolchain. Coincidentally 1.21 is also when forward compatibility was introduced.

You can test this

$ docker run -it --rm golang:1.19
% go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
...
pkg/mod/github.com/sqlc-dev/sqlc@latest/internal/bundler/upload.go:7:2: package log/slog is not in GOROOT (/usr/local/go/src/log/slog)
pkg/mod/github.com/sqlc-dev/sqlc@latest/internal/codegen/golang/opts/options.go:6:2: package maps is not in GOROOT (/usr/local/go/src/maps)

Go 1.21+ is required for recent versions of sqlc. This is because it uses components that require the 1.21 toolchain. Coincidentally 1.21 is also when forward compatibility was introduced.
Comment thread docs/overview/install.md
Comment on lines -25 to -30
### Go < 1.17:

```
go get github.com/sqlc-dev/sqlc/cmd/sqlc
```

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this since it's irrelevant now that Go 1.21 is required for maps and slog.

@jdahm jdahm changed the title Correct go install instructions fix(docs): correct go install instructions Apr 3, 2024
@kyleconroy kyleconroy merged commit 8e29add into sqlc-dev:main Apr 4, 2024
lisitsky pushed a commit to lisitsky/sqlc that referenced this pull request Jun 21, 2024
Go 1.21+ is required for recent versions of sqlc. This is because it uses components that require the 1.21 toolchain. Coincidentally 1.21 is also when forward compatibility was introduced.
alfonsodev pushed a commit to ExponentiaTeam/sqlc that referenced this pull request Oct 13, 2025
Go 1.21+ is required for recent versions of sqlc. This is because it uses components that require the 1.21 toolchain. Coincidentally 1.21 is also when forward compatibility was introduced.
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.

2 participants