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

task: add go toolchain #2779

Merged
merged 4 commits into from Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/code-health.yml
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v4.0.0
with:
version: v1.56.1
version: v1.56.2
unit-tests:
env:
COVERAGE: coverage.out
Expand Down
1 change: 0 additions & 1 deletion .tool-versions
Copy link
Collaborator Author

@gssbzn gssbzn Mar 19, 2024

Choose a reason for hiding this comment

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

since go can be its own version manager let's forget about asdf

This file was deleted.

3 changes: 2 additions & 1 deletion Makefile
@@ -1,6 +1,6 @@
# A Self-Documenting Makefile: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html

GOLANGCI_VERSION=v1.56.1
GOLANGCI_VERSION=v1.56.2
COVERAGE=coverage.out

MCLI_GIT_SHA?=$(shell git rev-parse HEAD)
Expand Down Expand Up @@ -28,6 +28,7 @@ export PATH := $(shell go env GOPATH)/bin:$(PATH)
export PATH := ./bin:$(PATH)
export TERM := linux-m
export GO111MODULE := on
export GOTOOLCHAIN := local
Copy link
Collaborator Author

@gssbzn gssbzn Mar 19, 2024

Choose a reason for hiding this comment

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

I found the "auto" behavior with asdf to be dangerous as it installs versions within the version manager so avoiding issues here

export ATLAS_E2E_BINARY

.PHONY: pre-commit
Expand Down
6 changes: 4 additions & 2 deletions go.mod
Expand Up @@ -2,6 +2,8 @@ module github.com/mongodb/mongodb-atlas-cli/atlascli

go 1.22
Copy link
Contributor

Choose a reason for hiding this comment

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

checked out to the branch and got:

  • do we need to do any setup to be able to update master?
❯ make deps
==> Installing go.mod dependencies...
go mod download
go: go.mod requires go >= 1.22 (running go 1.21.1; GOTOOLCHAIN=local)
make: *** [deps] Error 1

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

see #2779 (comment)

you need to install/set go1.22 however you are managing your go versions, I have swapped from asdf to using the homebrew version (asdf global golang system) but you can keep using asdf if that works for you

Copy link
Contributor

Choose a reason for hiding this comment

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

ok, if I set asdf global golang system, I still get the error, but if we set go 1.22.1 at line 3 then it works!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

, I still get the error,

I can't reproduce before doing that change can you confirm you have updated your env correctly, as in reload the shell env, via something like source ~/.zshrc, or restarting your term, and if you still get an error what's the output of go env?

Please consider that

go 1.22.1

should be equivalent to

go 1.22
toolchain go1.22.1

Copy link
Contributor

Choose a reason for hiding this comment

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

I think if it's not reproducible I can workaround to fix my machine, so I'll leave my stamp.

blva marked this conversation as resolved.
Show resolved Hide resolved

toolchain go1.22.1

require (
cloud.google.com/go/kms v1.15.8
github.com/AlecAivazis/survey/v2 v2.3.7
Expand All @@ -18,7 +20,7 @@ require (
github.com/briandowns/spinner v1.23.0
github.com/creack/pty v1.1.21
github.com/denisbrodbeck/machineid v1.0.1
github.com/evergreen-ci/shrub v0.0.0-20231121224157-600e066f9de6
github.com/evergreen-ci/shrub v0.0.0-20240215220116-3f233ddeff2a
github.com/gemalto/kmip-go v0.0.10
github.com/go-test/deep v1.1.0
github.com/golang-jwt/jwt/v4 v4.5.0
Expand All @@ -44,7 +46,7 @@ require (
go.mongodb.org/atlas-sdk/v20231115008 v20231115008.0.0
go.mongodb.org/mongo-driver v1.14.0
golang.org/x/crypto v0.21.0
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc
golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81
golang.org/x/mod v0.16.0
golang.org/x/tools v0.19.0
google.golang.org/api v0.170.0
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Expand Up @@ -122,8 +122,8 @@ github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLi
github.com/evanphx/json-patch/v5 v5.6.0/go.mod h1:G79N1coSVB93tBe7j6PhzjmR3/2VvlbKOFpnXhI9Bw4=
github.com/evanphx/json-patch/v5 v5.8.0 h1:lRj6N9Nci7MvzrXuX6HFzU8XjmhPiXPlsKEy1u0KQro=
github.com/evanphx/json-patch/v5 v5.8.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=
github.com/evergreen-ci/shrub v0.0.0-20231121224157-600e066f9de6 h1:LfvYiC/yIi91+6ykT8yaDfmzr67vcFUbQCbRg1ZbEj4=
github.com/evergreen-ci/shrub v0.0.0-20231121224157-600e066f9de6/go.mod h1:r6YQr77CR37LMhBdWcFrxqu5V+UhO+SYloHfd9vO1go=
github.com/evergreen-ci/shrub v0.0.0-20240215220116-3f233ddeff2a h1:Hsu++nuXl8MvWhcxjQyyZtdJDv85kVrDVxf0LcUoAmQ=
github.com/evergreen-ci/shrub v0.0.0-20240215220116-3f233ddeff2a/go.mod h1:r6YQr77CR37LMhBdWcFrxqu5V+UhO+SYloHfd9vO1go=
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
Expand Down Expand Up @@ -426,8 +426,8 @@ golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5y
golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM=
golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI=
golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81 h1:6R2FC06FonbXQ8pK11/PDFY6N6LWlf9KlzibaCapmqc=
golang.org/x/exp v0.0.0-20240318143956-a85f2c67cd81/go.mod h1:CQ1k9gNrJ50XIzaKCRR2hssIjF07kZFEiieALBM/ARQ=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
Expand Down