Skip to content

Commit 27fa1ef

Browse files
salemhilalDavid Schott
andauthored
Fix the linter, update golang versions. (#422)
* golangci to v3 per https://stackoverflow.com/questions/71758856/github-action-for-golangci-lint-fails-with-cant-load-fmt * add with latest * add setup-go and specific version * update version * Use only one actions/checkout, previous version of go linter The linter (`golangci`) and the action that runs the linter (`golangci/golangci-lint-action`) are separate. The linter seems to be running but finding new errors, so this change might be enough to temporarily squash those. * Drop go 1.12 and 1.13, add 1.17 and 1.18 There's a new golang version every 6 months. The latest two golang versions are supported officially. I'm keeping 1.14 around for now since it was previously the latest supported version. * Only run linter on 1.17 The 1.18 linter has import issues that we'll investigate later. * update version * nolint * nolint * nolint * nolint * update lint to go 1.18 Co-authored-by: David Schott <[email protected]>
1 parent c1ffa46 commit 27fa1ef

File tree

7 files changed

+289
-286
lines changed

7 files changed

+289
-286
lines changed

.github/workflows/go.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ jobs:
44
runs-on: ubuntu-latest
55
strategy:
66
matrix:
7-
go: ["1.14", "1.13", "1.12"]
7+
go: ["1.18", "1.17", "1.14"]
88
steps:
99
- uses: actions/[email protected]
1010
- uses: actions/setup-go@v2
@@ -56,20 +56,23 @@ jobs:
5656
name: lint
5757
strategy:
5858
matrix:
59-
go: ["1.14"]
59+
go: ["1.18"]
6060
os: [ubuntu-latest]
6161
runs-on: ${{ matrix.os }}
6262
steps:
63-
- uses: actions/[email protected]
63+
- uses: actions/checkout@v3
64+
- uses: actions/setup-go@v3
65+
with:
66+
go-version: ${{ matrix.go }}
6467
- name: golangci-lint
65-
uses: golangci/golangci-lint-action@v2.3.0
68+
uses: golangci/golangci-lint-action@v3
6669
with:
67-
# the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
68-
version: v1.35.2
70+
version: v1.46.2
71+
6972
go-test:
7073
strategy:
7174
matrix:
72-
go: ["1.14", "1.13", "1.12"]
75+
go: ["1.18", "1.17", "1.14"]
7376
os: [windows-latest, ubuntu-latest]
7477
runs-on: ${{ matrix.os }}
7578
steps:

client/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func repoNameFromUrl(uri string) string {
4141
}
4242

4343
name := uri[ax+1:]
44-
if strings.HasSuffix(name, ".git") {
44+
if strings.HasSuffix(name, ".git") { //nolint
4545
name = name[:len(name)-4]
4646
}
4747

cmds/houndd/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func makeSearchers(cfg *config.Config) (map[string]*searcher.Searcher, bool, err
4747
if len(errs) > 0 {
4848
// NOTE: This mutates the original config so the repos
4949
// are not even seen by other code paths.
50-
for name, _ := range errs { //nolint
50+
for name, _ := range errs { //nolint
5151
delete(cfg.Repos, name)
5252
}
5353

@@ -79,7 +79,7 @@ func registerShutdownSignal() <-chan os.Signal {
7979
return shutdownCh
8080
}
8181

82-
func makeTemplateData(cfg *config.Config) (interface{}, error) { //nolint
82+
func makeTemplateData(cfg *config.Config) (interface{}, error) { //nolint
8383
var data struct {
8484
ReposAsJson string
8585
}
@@ -98,7 +98,7 @@ func makeTemplateData(cfg *config.Config) (interface{}, error) { //nolint
9898
return &data, nil
9999
}
100100

101-
func runHttp( //nolint
101+
func runHttp( //nolint
102102
addr string,
103103
dev bool,
104104
cfg *config.Config,
@@ -164,7 +164,7 @@ func main() {
164164
handleShutdown(shutdownCh, idx)
165165

166166
host := *flagAddr
167-
if strings.HasPrefix(host, ":") {
167+
if strings.HasPrefix(host, ":") { //nolint
168168
host = "localhost" + host
169169
}
170170

0 commit comments

Comments
 (0)