From: Simon Ruderich Date: Wed, 12 Jun 2019 06:48:16 +0000 (+0200) Subject: nsscash: replace %s with %v in format string for File.Type X-Git-Tag: 0.1~58 X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=d72650db8abe817b328754fb2e33137346058f15;p=nsscash%2Fnsscash.git nsscash: replace %s with %v in format string for File.Type File.Type is an int value with a stringer go:generate statement. Using %s breaks running `go test` (which runs `go vet`) before running `go generate`. Using %v has the same result and uses the stringified version when available. --- diff --git a/file.go b/file.go index 02bc767..b77cbb6 100644 --- a/file.go +++ b/file.go @@ -39,7 +39,7 @@ func handleFiles(cfg *Config, state *State) error { for i, f := range cfg.Files { err := fetchFile(&cfg.Files[i], state) if err != nil { - return errors.Wrapf(err, "%q (%s)", f.Url, f.Type) + return errors.Wrapf(err, "%q (%v)", f.Url, f.Type) } } @@ -51,7 +51,7 @@ func handleFiles(cfg *Config, state *State) error { err := deployFile(&cfg.Files[i]) if err != nil { - return errors.Wrapf(err, "%q (%s)", f.Url, f.Type) + return errors.Wrapf(err, "%q (%v)", f.Url, f.Type) } }