Bump golangci-lint and fix lint
This commit is contained in:
parent
9042405ea0
commit
b5b0558d58
|
|
@ -67,7 +67,7 @@ jobs:
|
|||
uses: golangci/golangci-lint-action@v6
|
||||
with:
|
||||
working-directory: git-sync
|
||||
version: v1.53.3
|
||||
version: v1.59.0
|
||||
|
||||
- name: make lint
|
||||
working-directory: git-sync
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -281,6 +281,6 @@ lint-staticcheck:
|
|||
go run honnef.co/go/tools/cmd/staticcheck@2023.1.3
|
||||
|
||||
lint-golangci-lint:
|
||||
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.3 run
|
||||
go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.0 run
|
||||
|
||||
lint: lint-staticcheck lint-golangci-lint
|
||||
|
|
|
|||
12
main.go
12
main.go
|
|
@ -142,7 +142,7 @@ func main() {
|
|||
flVersion := pflag.Bool("version", false, "print the version and exit")
|
||||
flHelp := pflag.BoolP("help", "h", false, "print help text and exit")
|
||||
pflag.BoolVarP(flHelp, "__?", "?", false, "print help text and exit") // support -? as an alias to -h
|
||||
pflag.CommandLine.MarkHidden("__?")
|
||||
mustMarkHidden("__?")
|
||||
flManual := pflag.Bool("man", false, "print the full manual and exit")
|
||||
|
||||
flVerbose := pflag.IntP("verbose", "v",
|
||||
|
|
@ -923,6 +923,16 @@ func mustMarkDeprecated(name string, usageMessage string) {
|
|||
}
|
||||
}
|
||||
|
||||
// mustMarkHidden is a helper around pflag.CommandLine.MarkHidden.
|
||||
// It panics if there is an error (as these indicate a coding issue).
|
||||
// This makes it easier to keep the linters happy.
|
||||
func mustMarkHidden(name string) {
|
||||
err := pflag.CommandLine.MarkHidden(name)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("error marking flag %q as hidden: %v", name, err))
|
||||
}
|
||||
}
|
||||
|
||||
// makeAbsPath makes an absolute path from a path which might be absolute
|
||||
// or relative. If the path is already absolute, it will be used. If it is
|
||||
// not absolute, it will be joined with the provided root. If the path is
|
||||
|
|
|
|||
Loading…
Reference in New Issue