Skip to content

Commit dae0793

Browse files
committed
fix github action
1 parent abc6380 commit dae0793

File tree

6 files changed

+23
-38
lines changed

6 files changed

+23
-38
lines changed

.github/workflows/go.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: Go
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77

88
pull_request:
99
branches:
10-
- master
10+
- main
1111

1212
permissions:
1313
actions: none
@@ -26,15 +26,11 @@ jobs:
2626
name: Build
2727
runs-on: ubuntu-latest
2828
steps:
29-
30-
- name: Set up Go 1.x
31-
uses: actions/setup-go@v2
29+
- uses: actions/setup-go@v3
3230
with:
33-
go-version: ^1.16
34-
id: go
31+
go-version: 1.17
3532

36-
- name: Check out code into the Go module directory
37-
uses: actions/checkout@v2
33+
- uses: actions/checkout@v3
3834

3935
- name: Build
4036
run: make build

.github/workflows/golangci-lint.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ on:
55
tags:
66
- v*
77
branches:
8-
- master
8+
- main
99

1010
pull_request:
1111
branches:
12-
- master
12+
- main
1313

1414
permissions:
1515
actions: none
@@ -28,8 +28,13 @@ jobs:
2828
name: lint
2929
runs-on: ubuntu-latest
3030
steps:
31-
- uses: actions/checkout@v2
32-
- name: golangci-lint
33-
uses: golangci/golangci-lint-action@v2
34-
with:
35-
version: v1.39
31+
- uses: actions/setup-go@v3
32+
with:
33+
go-version: 1.17
34+
35+
- uses: actions/checkout@v3
36+
37+
- name: golangci-lint
38+
uses: golangci/golangci-lint-action@v3
39+
with:
40+
version: latest

.github/workflows/snyk.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ jobs:
1818
security:
1919
runs-on: ubuntu-latest
2020
steps:
21-
- uses: actions/checkout@master
21+
- uses: actions/checkout@v3
22+
2223
- name: Run Snyk to check for vulnerabilities
2324
uses: snyk/actions/golang@master
2425
env:

.golangci.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ linters-settings:
77
severity: warning
88
rules:
99
- name: atomic
10-
# - name: bare-return
1110
- name: blank-imports
1211
- name: bool-literal-in-expr
1312
- name: call-to-gc
@@ -28,7 +27,6 @@ linters-settings:
2827
- name: error-strings
2928
- name: errorf
3029
- name: exported
31-
# - name: flag-parameter
3230
- name: get-return
3331
- name: identical-branches
3432
- name: if-return
@@ -50,11 +48,9 @@ linters-settings:
5048
- name: unconditional-recursion
5149
- name: unexported-naming
5250
- name: unexported-return
53-
# - name: unhandled-error
5451
- name: unnecessary-stmt
5552
- name: unreachable-code
5653
- name: unused-parameter
57-
# - name: unused-receiver
5854
- name: var-declaration
5955
- name: var-naming
6056
- name: waitgroup-by-value
@@ -64,38 +60,30 @@ linters:
6460
enable:
6561
- asciicheck
6662
- bodyclose
67-
# - cyclop
6863
- deadcode
6964
- dogsled
7065
- dupl
7166
- durationcheck
7267
- errcheck
7368
- errorlint
7469
- exhaustive
75-
# - exhaustivestruct
7670
- exportloopref
77-
# - forbidigo
7871
- forcetypeassert
7972
- funlen
80-
# - gci
81-
# - gochecknoglobals
8273
- gochecknoinits
8374
- gocognit
8475
- goconst
8576
- gocritic
8677
- gocyclo
8778
- godot
8879
- godox
89-
- goerr113
9080
- goimports
91-
- gomnd
9281
- gomoddirectives
9382
- gomodguard
9483
- goprintffuncname
9584
- gosec
9685
- gosimple
9786
- govet
98-
# - ifshort
9987
- importas
10088
- ineffassign
10189
- lll
@@ -104,20 +92,16 @@ linters:
10492
- nakedret
10593
- nestif
10694
- nilerr
107-
# - nlreturn
10895
- noctx
10996
- nolintlint
110-
# - paralleltest
11197
- prealloc
11298
- predeclared
113-
# - promlinter
11499
- revive
115100
- rowserrcheck
116101
- sqlclosecheck
117102
- staticcheck
118103
- structcheck
119104
- stylecheck
120-
# - tagliatelle
121105
- testpackage
122106
- thelper
123107
- tparallel
@@ -126,7 +110,5 @@ linters:
126110
- unparam
127111
- unused
128112
- varcheck
129-
# - wastedassign
130113
- whitespace
131-
# - wrapcheck
132114
- wsl

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ clean:
3333
rm -rf dist/
3434
rm -f gomodguard coverage.xml coverage.out
3535

36-
.PHONY: install-tools-mac
36+
.PHONY: install-mac-tools
3737
install-tools-mac:
3838
brew install goreleaser/tap/goreleaser
3939

gomodguard.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ var (
3232
blockReasonHasLocalReplaceDirective = "import of package `%s` is blocked because the module has a " +
3333
"local replace directive."
3434

35-
// startsWithVersion is used to test when a string begins with the version identifier of a module, after having stripped the prefix base module name
36-
// ie "github.com/foo/bar/v2/baz" => "/v2/baz" probably indicates that the module is actually github.com/foo/bar/v2, not github.com/foo/bar
35+
// startsWithVersion is used to test when a string begins with the version identifier of a module,
36+
// after having stripped the prefix base module name. IE "github.com/foo/bar/v2/baz" => "/v2/baz"
37+
// probably indicates that the module is actually github.com/foo/bar/v2, not github.com/foo/bar.
3738
startsWithVersion = regexp.MustCompile(`^\/v[0-9]+`)
3839
)
3940

0 commit comments

Comments
 (0)