Skip to content

Commit

Permalink
lint: remove golint
Browse files Browse the repository at this point in the history
golint is deprecated and frozen since 2021. I don't think it provides
much value on top of go vet and staticcheck and it is very slow (it
currently takes ~90 seconds on my machine).

This change removes `TestGolint`.
  • Loading branch information
RaduBerinde committed Aug 21, 2024
1 parent aa96305 commit d4348d0
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 34 deletions.
1 change: 0 additions & 1 deletion internal/devtools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ go 1.22

require (
github.com/cockroachdb/crlfmt v0.0.0-20230505164321-461e8663b4b4
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616
honnef.co/go/tools v0.4.7
)

Expand Down
13 changes: 0 additions & 13 deletions internal/devtools/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,16 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a h1:Jw5wfR+h9mnIYH+OtGT2im5wV1YGGDora5vTv/aa5bE=
golang.org/x/exp/typeparams v0.0.0-20221208152030-732eee02a75a/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM=
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.12.1-0.20230825192346-2191a27a6dc5 h1:Vk4mysSz+GqQK2eqgWbo4zEO89wkeAjJiFIr9bpqa8k=
golang.org/x/tools v0.12.1-0.20230825192346-2191a27a6dc5/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
honnef.co/go/tools v0.4.7 h1:9MDAWxMoSnB6QoSqiVr7P5mtkT9pOc1kSxchzPCnqJs=
Expand Down
1 change: 0 additions & 1 deletion internal/devtools/tools.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@ package tools

import (
_ "github.com/cockroachdb/crlfmt"
_ "golang.org/x/lint/golint"
_ "honnef.co/go/tools/cmd/staticcheck"
)
20 changes: 1 addition & 19 deletions internal/lint/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (

const (
cmdGo = "go"
golint = "golang.org/x/lint/golint"
staticcheck = "honnef.co/go/tools/cmd/staticcheck"
crlfmt = "github.com/cockroachdb/crlfmt"
)
Expand All @@ -46,7 +45,7 @@ func ignoreGoMod() stream.Filter {
}

func installTool(t *testing.T, path string) {
cmd := exec.Command("go", "install", "-C", "../devtools", path)
cmd := exec.Command(cmdGo, "install", "-C", "../devtools", path)
out, err := cmd.CombinedOutput()
if err != nil {
t.Fatalf("cannot install %q: %v\n%s\n", path, err, out)
Expand Down Expand Up @@ -97,23 +96,6 @@ func TestLint(t *testing.T) {
}
})

t.Run("TestGolint", func(t *testing.T) {
installTool(t, golint)
t.Parallel()

// This is overkill right now, but provides a structure for filtering out
// lint errors we don't care about.
if err := stream.ForEach(
stream.Sequence(
dirCmd(t, pkg.Dir, "golint", pkgs...),
stream.GrepNot("go: downloading"),
), func(s string) {
t.Errorf("\n%s", s)
}); err != nil {
t.Error(err)
}
})

t.Run("TestStaticcheck", func(t *testing.T) {
installTool(t, staticcheck)
t.Parallel()
Expand Down

0 comments on commit d4348d0

Please sign in to comment.