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

golint checks in make verify throw GOROOT error #1743

Closed
rbrtl opened this issue Dec 9, 2021 · 0 comments · Fixed by #1744
Closed

golint checks in make verify throw GOROOT error #1743

rbrtl opened this issue Dec 9, 2021 · 0 comments · Fixed by #1744

Comments

@rbrtl
Copy link
Contributor

rbrtl commented Dec 9, 2021

Describe the bug

Linting during verify Makefile task returns error for each module in Athens as "not in GOROOT" with the GO111MODULE=off setting.

Error Message

```package _/Users/me/path/to/athens/cmd/proxy is not in GOROOT (/usr/local/Cellar/go/1.17.3/libexec/src/_/Users/me/path/to/go/athens/cmd/proxy)
```

To Reproduce

make verify

Expected behavior

No errors thrown by golint and status 0 returned

Environment (please complete the following information):

  • OS: Darwin Kernel Version 20.6.0: Tue Oct 12 18:33:42 PDT 2021; root:xnu-7195.141.8~1/RELEASE_X86_64 x86_64 (macOS Big Sur 11.6.1)
  • Go version : 1.17.3
  • Proxy version : N/A
  • Storage (fs/mongodb/s3 etc.) : N/A

Additional context

The current verify script also returns status 0 but clogs up output with lines that look like errors. I am possibly not familiar enough with the workings of GO111MODULE but setting this to on seems to completely clear up the issue, and I don't understand why we would run listing with the modules option deliberately off.

rbrtl added a commit to rbrtl/athens that referenced this issue Dec 9, 2021
As mentioned in gomods#1743 the Go modules environment flag is set to `off`
in the script which appears to cause a warning message for each module
of the codebase that it is "not in GOROOT".

Set to `auto` as this allows the same build to be run the original way
should someone choose to delete the `go.mod` file from the project root.
manugupt1 pushed a commit that referenced this issue Dec 10, 2021
* Set GO111MODULE to auto in golint script– #1743

As mentioned in #1743 the Go modules environment flag is set to `off`
in the script which appears to cause a warning message for each module
of the codebase that it is "not in GOROOT".

Set to `auto` as this allows the same build to be run the original way
should someone choose to delete the `go.mod` file from the project root.

* Remove redundant code – golint script

Go 1.17 ignores `GO111MODULE` and there are no directories in the
project root called `mock`.

* Replace `golint` with `go vet`

`golint` is deprecated (and frozen) replace with the current `go vet`.
This reported one issue on `main` branch:
```pkg/stash/with_etcd.go:33:28:
loop variable ep captured by func literal```

Fixed loop variable capture with extraction to parameterised anonymous
function passed loop variable and passed in to `errgroup.Go` call.
marwan-at-work pushed a commit that referenced this issue Dec 11, 2021
* Set GO111MODULE to auto in golint script– #1743

As mentioned in #1743 the Go modules environment flag is set to `off`
in the script which appears to cause a warning message for each module
of the codebase that it is "not in GOROOT".

Set to `auto` as this allows the same build to be run the original way
should someone choose to delete the `go.mod` file from the project root.

* Remove redundant code – golint script

Go 1.17 ignores `GO111MODULE` and there are no directories in the
project root called `mock`.

* Replace `golint` with `go vet`

`golint` is deprecated (and frozen) replace with the current `go vet`.
This reported one issue on `main` branch:
```pkg/stash/with_etcd.go:33:28:
loop variable ep captured by func literal```

Fixed loop variable capture with extraction to parameterised anonymous
function passed loop variable and passed in to `errgroup.Go` call.

* Finish Removing `golint`

Removed remaining references to `golint` in dev doc, Makefile,
bash scripts, and powershell build scripts.
Removed `get_dev_tools.sh` and `get_dev_tools.ps1` as they only install
the removed `golint` package.
rbrtl added a commit to rbrtl/athens that referenced this issue Dec 13, 2021
As mentioned in gomods#1743 the Go modules environment flag is set to `off`
in the script which appears to cause a warning message for each module
of the codebase that it is "not in GOROOT".

Set to `auto` as this allows the same build to be run the original way
should someone choose to delete the `go.mod` file from the project root.
rbrtl added a commit to rbrtl/athens that referenced this issue Dec 13, 2021
As mentioned in gomods#1743 the Go modules environment flag is set to `off`
in the script which appears to cause a warning message for each module
of the codebase that it is "not in GOROOT".

Set to `auto` as this allows the same build to be run the original way
should someone choose to delete the `go.mod` file from the project root.
rbrtl added a commit to rbrtl/athens that referenced this issue Dec 13, 2021
As mentioned in gomods#1743 the Go modules environment flag is set to `off`
in the script which appears to cause a warning message for each module
of the codebase that it is "not in GOROOT".

Set to `auto` as this allows the same build to be run the original way
should someone choose to delete the `go.mod` file from the project root.
rbrtl added a commit to rbrtl/athens that referenced this issue Dec 13, 2021
As mentioned in gomods#1743 the Go modules environment flag is set to `off`
in the script which appears to cause a warning message for each module
of the codebase that it is "not in GOROOT".

Set to `auto` as this allows the same build to be run the original way
should someone choose to delete the `go.mod` file from the project root.
rbrtl added a commit to rbrtl/athens that referenced this issue Dec 19, 2021
As mentioned in gomods#1743 the Go modules environment flag is set to `off`
in the script which appears to cause a warning message for each module
of the codebase that it is "not in GOROOT".

Set to `auto` as this allows the same build to be run the original way
should someone choose to delete the `go.mod` file from the project root.
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 a pull request may close this issue.

1 participant