Add staticcheck to CI (#171)

This commit is contained in:
Filippo Valsorda
2019-07-05 01:41:23 -03:00
committed by GitHub
parent 4d2ab596e7
commit 1f0796c926
2 changed files with 5 additions and 4 deletions

View File

@@ -1,10 +1,11 @@
language: go language: go
sudo: false sudo: false
go: stable go: stable
install: "# skip" install: (cd && go get honnef.co/go/tools/cmd/staticcheck)
script: script:
- go vet - go vet
- staticcheck ./...
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "mkcert-$(git describe --tags)-linux-amd64" - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "mkcert-$(git describe --tags)-linux-amd64"
- CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -o "mkcert-$(git describe --tags)-linux-arm" - CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=6 go build -o "mkcert-$(git describe --tags)-linux-arm"
- CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o "mkcert-$(git describe --tags)-darwin-amd64" - CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o "mkcert-$(git describe --tags)-darwin-amd64"

View File

@@ -92,13 +92,13 @@ func main() {
p12FileFlag = flag.String("p12-file", "", "") p12FileFlag = flag.String("p12-file", "", "")
) )
flag.Usage = func() { flag.Usage = func() {
fmt.Fprintf(flag.CommandLine.Output(), shortUsage) fmt.Fprint(flag.CommandLine.Output(), shortUsage)
fmt.Fprintln(flag.CommandLine.Output(), `For more options, run "mkcert -help".`) fmt.Fprintln(flag.CommandLine.Output(), `For more options, run "mkcert -help".`)
} }
flag.Parse() flag.Parse()
if *helpFlag { if *helpFlag {
fmt.Fprintf(flag.CommandLine.Output(), shortUsage) fmt.Fprint(flag.CommandLine.Output(), shortUsage)
fmt.Fprintf(flag.CommandLine.Output(), advancedUsage) fmt.Fprint(flag.CommandLine.Output(), advancedUsage)
return return
} }
if *carootFlag { if *carootFlag {