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

GO 1.17 migration #838

Merged
merged 1 commit into from
Jan 22, 2022
Merged

GO 1.17 migration #838

merged 1 commit into from
Jan 22, 2022

Conversation

kuritka
Copy link
Collaborator

@kuritka kuritka commented Jan 21, 2022

  • zz_generated.deepcopy.go was modified by us because we have different versions of GO
    and contains two tags, one for generating GO <1.16 //+build, one for generating GO >= 1.17 //go:build.
    I am removing the GO1.16 tag.

  • Bump GO version in *.mod files.
    Because in Go 1.17 the module graph has been changed to enable pruning and lazy loading. The go mod tidy adds second
    require block contains indirect dependencies. see: https://go.dev/doc/go1.17#go-command

    • Because the number of explicit requirements may be substantially larger in an expanded Go 1.17 go.mod file, the newly-added requirements on indirect dependencies in a go 1.17 module are maintained in a separate require block from the block containing direct dependencies.
    • [...] If a module specifies go 1.17 or higher in its go.mod file, its go.mod file now contains an explicit require directive for every module that provides a transitively-imported package. (In previous versions, the go.mod file typically only included explicit requirements for directly-imported packages.)
    • If a module specifies go 1.17 or higher, the module graph includes only the immediate dependencies of other go 1.17 modules, not their full transitive dependencies. [...]
  • Build pipes runs on GO 1.17.6 as it is supported by github virtual environment

⚠️ Attention

one thing is what version of GO you have installed, another is what version you have in GOROOT and finally it is about what version your IDE runs.

  • You make sure you use GO1.17 by default
go version
  • Check $GOROOT to be sure it's 1.17

  • Check what version your IDE is using:
    For example, in GoLand click on GoLand menu ->Preferences -> Go -> choose $GOROOT dropdown

Signed-off-by: kuritka kuritka@gmail.com

- `zz_generated.deepcopy.go` was modified by us because we have different versions of GO
and contains two tags, one for generating GO <1.16 `//+build`, one for generating GO >= 1.17 `//go:build`.
I am removing the `GO1.16` tag.

- Bump GO version in *.mod files.
Because in Go 1.17 the module graph has been changed to enable pruning and lazy loading. The `go mod tidy` adds second
require block contains indirect dependencies. see: https://go.dev/doc/go1.17#go-command
   - _Because the number of explicit requirements may be substantially larger in an expanded Go 1.17 go.mod file, the newly-added requirements on indirect dependencies in a go 1.17 module are maintained in a separate require block from the block containing direct dependencies._
   - _[...] If a module specifies go 1.17 or higher in its go.mod file, its go.mod file now contains an explicit require directive for every module that provides a transitively-imported package. (In previous versions, the go.mod file typically only included explicit requirements for directly-imported packages.)_
   - _If a module specifies go 1.17 or higher, the module graph includes only the immediate dependencies of other go 1.17 modules, not their full transitive dependencies. [...]_

- Build pipes runs on GO 1.17.6 as it is supported by [github virtual environment](https://go.dev/doc/go1.17#go-command)

one thing is what version of GO you have installed, another is what version you have in GOROOT and finally it is about what version your IDE runs.

- You make sure you use GO1.17 by default
```shell
go version
```
- Check `$GOROOT` to be sure.

- Check what version your IDE is using:
For example, in GoLand click on `GoLand menu ->Preferences -> Go -> choose $GOROOT dropdown`

Signed-off-by: kuritka <kuritka@gmail.com>
@netlify
Copy link

netlify bot commented Jan 21, 2022

✔️ Deploy Preview for k8gb-preview ready!

🔨 Explore the source changes: 4ebbbbe

🔍 Inspect the deploy log: https://app.netlify.com/sites/k8gb-preview/deploys/61ead3692ea3f000080942d1

😎 Browse the preview: https://deploy-preview-838--k8gb-preview.netlify.app/docs/local

@kuritka kuritka merged commit 155bb57 into master Jan 22, 2022
@kuritka kuritka deleted the go117-migration branch January 22, 2022 21:04
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.

3 participants