Skip to content

Commit

Permalink
Finish Removing golint (gomods#1746)
Browse files Browse the repository at this point in the history
* Set GO111MODULE to auto in golint script– gomods#1743

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.

* 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.
  • Loading branch information
rbrtl authored Dec 11, 2021
1 parent 2f49984 commit 567c939
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 21 deletions.
4 changes: 2 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ Then open [http://localhost:1313](http://localhost:1313/).

# Linting

In our CI/CD pass, we use golint, so feel free to install and run it locally beforehand:
In our CI/CD pass, we use govet, so feel free to run it locally beforehand:

```
go get golang.org/x/lint/golint
go vet ./...
```

# For People Doing a Release
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ docs: ## build the docs docker image

.PHONY: setup-dev-env
setup-dev-env:
./scripts/get_dev_tools.sh
$(MAKE) dev

.PHONY: verify
Expand Down
4 changes: 2 additions & 2 deletions docs/content/contributing/new/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ Then open [http://localhost:1313](http://localhost:1313/).

# Linting

In our CI/CD pass, we use golint, so feel free to install and run it locally beforehand:
In our CI/CD pass, we use govet, so feel free to run it locally beforehand:

```
go get golang.org/x/lint/golint
go vet ./...
```
3 changes: 1 addition & 2 deletions init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ function execScript($name) {
}

if ($setup_dev_env.IsPresent) {
execScript "get_dev_tools.ps1"
& docker-compose -p athensdev up -d mongo
}

Expand Down Expand Up @@ -81,7 +80,7 @@ if ($docs.IsPresent) {

if ($verify.IsPresent) {
execScript "check_gofmt.ps1"
execScript "check_golint.ps1"
execScript "check_govet.ps1"
execScript "check_deps.ps1"
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/check_govet.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

# check_golint.sh
# check_govet.sh
# Run the linter on everything except generated code
set -euo pipefail

Expand Down
7 changes: 0 additions & 7 deletions scripts/get_dev_tools.sh

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/ps/check_golint.ps1 → scripts/ps/check_govet.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# check_golint.ps1
# check_govet.ps1
# Run the linter on everything

$out = & golint -set_exit_status $(& go list ./...)
$out = & go vet ./...
if ($LastExitCode -ne 0) {
Write-Error $out
}
4 changes: 0 additions & 4 deletions scripts/ps/get_dev_tools.ps1

This file was deleted.

0 comments on commit 567c939

Please sign in to comment.