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.18 released #557

Closed
4 of 5 tasks
atc0005 opened this issue Mar 16, 2022 · 5 comments
Closed
4 of 5 tasks

Go 1.18 released #557

atc0005 opened this issue Mar 16, 2022 · 5 comments

Comments

@atc0005
Copy link
Owner

atc0005 commented Mar 16, 2022

Overview

Need to refresh oldstable to use Go 1.17 and stable to use the new Go 1.18 version.

References to Go 1.16 can be removed entirely.

The Go 1.18rc1-based unstable container can be updated to 1.18 for the time being until the first 1.19-based pre-release becomes available.

NOTE: golangci-lint is still not 1.18 "certified", so will need to build from source for the time being. This requires updating the stable variants to match the current unstable container, while keeping the oldstable container logic (e.g., install via official installation script) intact.

TODO

  • update oldstable image to use Go 1.17
  • update stable image to use Go 1.18
    • update stable image to use same steps as unstable image for building/installing current golangci-lint
      • building from source is needed until golangci-lint officially supports Go 1.18 (and running within a Go 1.18 container)
      • not needed for oldstable image (now based on Go 1.17)
  • update unstable image to use Go 1.18
  • remove any references to Go 1.16

References

@atc0005
Copy link
Owner Author

atc0005 commented Mar 16, 2022

Note to self:

Probably worth making changes in small steps.

Update unstable image to official Go 1.18 release, but keep the stable image on 1.17 for the time being for best compatibility with golangci-lint.

Not sure yet about the oldstable image.

@atc0005
Copy link
Owner Author

atc0005 commented Mar 18, 2022

Update unstable image to official Go 1.18 release

Using golangci-lint with Go 1.18 requires a new setting. Some linters are disabled when enabling Go 1.18 support.

See:

Example (borrowed from goreleaser/goreleaser#2989):

diff --git a/.golangci.yaml b/.golangci.yaml
index 126b222f13..a0731d5063 100644
--- a/.golangci.yaml
+++ b/.golangci.yaml
@@ -1,3 +1,5 @@
+run:
+  go: 1.18
 linters:
   enable:
     - thelper

atc0005 added a commit that referenced this issue Mar 21, 2022
- Update Dockerfile ENV values
- Update README tools version table

refs GH-563
refs GH-564
refs GH-557
@atc0005
Copy link
Owner Author

atc0005 commented Mar 21, 2022

Note: The golangci-lint v1.45.0 Docker images were updated to use Go 1.18 as the base:

Since we're postponing upgrading "stable" images for this project to Go 1.18, I may need to update the stable-lint-only image to explicitly use Go 1.17 as the base.

atc0005 added a commit that referenced this issue Mar 21, 2022
Disable Dependabot Go 1.18 Docker updates until newer versions
of golangci-lint resolve compatibility issues.

refs GH-557
@atc0005 atc0005 modified the milestones: v0.6.4, Future Mar 21, 2022
atc0005 added a commit that referenced this issue Mar 25, 2022
- Update Dockerfile ENV values
- Update README tools version table

refs GH-576
refs GH-557
@atc0005 atc0005 pinned this issue Jun 19, 2022
@atc0005
Copy link
Owner Author

atc0005 commented Jun 19, 2022

Go 1.19beta1 has been released. Cross-post from #656 (comment):

It's time to update the images accordingly:

  • Go 1.16 dropped, 1.17 becomes the oldstable version
  • Go 1.18 is used for stable variants
  • Go 1.19 is used for unstable

We'll need to drop any hard-coded Go 1.17 specific settings in golangci-lint and allow auto-detection to take place.

@atc0005 atc0005 unpinned this issue Jun 19, 2022
atc0005 added a commit that referenced this issue Jun 19, 2022
CHANGES

- each image type (`stable`, `unstable`, `oldstable`) has their own
  copy of the golangci-lint config file with the `stable` variants
  being given a copy of the via the Makefile build recipe
- each image type (`stable`, `unstable`, `oldstable`) is given a copy
  of the markdownlint config file via Makefile build recipe
- Makefile clean recipe updated to remove temporary copies of linter
	config files
- Makefile build recipe updated to limit copying of linter config
  files to just the images which use them
- `oldstable` image
  - explicitly specifies the Go version limit for golangci-lint as Go
    1.17
  - updated Go from `1.16.15` to `1.17.11`
- `unstable` image
  - explicitly specifies the Go version limit for golangci-lint as Go
    1.18 (for now)
  - updated Go from `1.18.3` to `1.19beta1`
- `stable` image
  - variants providing the golangci-lint linter explicitly specify the
    Go version limit for golangci-lint as Go 1.18
  - updated Go from `1.17.11` to `1.18.3`
- update README to drop compatibility notes regarding the `oldstable`
  image and older `staticcheck` version used for Go 1.16 compatibility
- update go.mod file to reflect current stable version of Go (1.18)
  with a note to update the version going forward

refs GH-557
refs GH-656
@atc0005 atc0005 modified the milestones: Future, Next Release Jun 19, 2022
@atc0005
Copy link
Owner Author

atc0005 commented Jun 19, 2022

Considering the core work complete. The process of updating the disable linters list to drop linters which have gained Go 1.18 compatibility will be an ongoing process.

@atc0005 atc0005 closed this as completed Jun 19, 2022
atc0005 added a commit that referenced this issue Jun 20, 2022
As part of promoting the versions of Go used in each image
type the linters enabled for the unstable image were ported
as-is to the stable container.

This commit reverts the unintended changes restoring the
original list of linters used by the unstable image.

Specifically:

- errcheck
- gochecknoglobals
- gocognit
- gocyclo
- goerr113

refs GH-557
refs GH-656
refs GH-658
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant