dominikh/Staticcheck

Run Staticcheck on your Go code

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Mar 4, 2026
License
MIT

Pinned Snippet

workflow.ymlSHA-pinned
uses: dominikh/staticcheck-action@9716614d4101e79b4340dd97b10e54d68234e431 # v1.4.1

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
versionThe version of Staticcheck to use. Because new versions of Staticcheck introduce new checks that may break your build, it is recommended to pin to a specific version and to update Staticheck consciously. yeslatest
min-go-versionMinimum version of Go to support. This affects the diagnostics reported by Staticcheck, avoiding suggestions that are not applicable to older versions of Go. If unset, this will default to the Go version specified in your go.mod. See https://staticcheck.io/docs/running-staticcheck/cli/#go for more information. nomodule
build-tagsBuild tagsno
checksValue to pass to Staticcheck in the -checks flag. This doesn't normally need to be set. noinherit
install-goLet the action install the latest version of Go. If set to false, the action expects you to have installed Go already. The latest release of Staticcheck works with the last minor release of Go at that time. The action itself requires at least Go 1.16. yestrue
use-cacheIf set to true (the default), this action will automatically save and restore Staticcheck's cache using the actions/cache action. notrue
cache-keyString to include in the cache key, in addition to the default, which is runner.os. This is useful when using multiple Go versions. no
working-directoryRelative path to the working directory Staticcheck should be executed in. This is useful when dealing with multiple projects within one repository. no.
output-formatOutput format to use. This corresponds to Staticcheck's -f flag. Usually you will want to use the default ("text"), as this format creates annotations on pull requests. When combining multiple runs with merge-files, you want to use the "binary" format on the individual runs to create the inputs to the merge run. notext
output-fileFile to write Staticcheck's output to. Defaults to stdout. no
merge-filesA newline-separated list of files to pass to "staticcheck -merge". no

no outputs