Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO NOT MERGE - staticcheck test #3001

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/lint.sh
@@ -0,0 +1,9 @@
#!/bin/bash

go get honnef.co/go/tools/cmd/staticcheck

output=$(staticcheck ./...)
code=$?

echo "$output"
exit $code
11 changes: 6 additions & 5 deletions .github/workflows/lint.yml
Expand Up @@ -16,8 +16,9 @@ jobs:
go mod tidy
diff go.mod go.mod.orig
diff go.sum go.sum.orig
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.34.1
- run: go get honnef.co/go/tools/cmd/staticcheck
- run: staticcheck ./...
- name: annotate
run: |
text="Test error"
echo "::error file=example/staticerrors/main.go,line=10,col=2::$text"
19 changes: 19 additions & 0 deletions example/staticerrors/main.go
@@ -0,0 +1,19 @@
package main

import "fmt"

type user struct {
name string
age int
}

func main() {
fmt.Println(getHello())

u := &user{name: "John Doe"}
fmt.Println(u)
}

func getHello() string {
return fmt.Sprintf("Hallo")
}