Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit045ecd3

Browse files
radar07SamMorrowDrums
authored andcommitted
feat: addgolangci-lint-action to thelint workflow
1 parenteca853b commit045ecd3

File tree

1 file changed

+5
-30
lines changed

1 file changed

+5
-30
lines changed

‎.github/workflows/lint.yaml

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,9 @@ jobs:
1717
-name:Set up Go
1818
uses:actions/setup-go@v5
1919
with:
20-
go-version-file:'go.mod'
20+
go-version-file:"go.mod"
2121

22-
-name:Verify dependencies
23-
run:|
24-
go mod verify
25-
go mod download
26-
27-
LINT_VERSION=2.1.6
28-
curl -fsSL https://github.com/golangci/golangci-lint/releases/download/v${LINT_VERSION}/golangci-lint-${LINT_VERSION}-linux-amd64.tar.gz | \
29-
tar xz --strip-components 1 --wildcards \*/golangci-lint
30-
mkdir -p bin && mv golangci-lint bin/
31-
32-
-name:Run checks
33-
run:|
34-
STATUS=0
35-
assert-nothing-changed() {
36-
local diff
37-
"$@" >/dev/null || return 1
38-
if ! diff="$(git diff -U1 --color --exit-code)"; then
39-
printf '\e[31mError: running `\e[1m%s\e[22m` results in modifications that you must check into version control:\e[0m\n%s\n\n' "$*" "$diff" >&2
40-
git checkout -- .
41-
STATUS=1
42-
fi
43-
}
44-
45-
assert-nothing-changed go fmt ./...
46-
assert-nothing-changed go mod tidy
47-
48-
bin/golangci-lint run --timeout=3m || STATUS=$?
49-
50-
exit $STATUS
22+
-name:golangci-lint
23+
uses:golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9
24+
with:
25+
version:v2.1.6

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp