Remove linebreak from Errorf() format string

This commit is contained in:
Alexander Neumann 2017-07-23 15:51:44 +02:00
parent 61c5e4b54a
commit 6302444f34

View file

@ -45,7 +45,7 @@ type TravisEnvironment struct {
func (env *TravisEnvironment) getMinio() error {
tempfile, err := os.Create(filepath.Join(os.Getenv("GOPATH"), "bin", "minio"))
if err != nil {
return fmt.Errorf("create tempfile for minio download failed: %v\n", err)
return fmt.Errorf("create tempfile for minio download failed: %v", err)
}
url := fmt.Sprintf("https://dl.minio.io/server/minio/release/%s-%s/minio",
@ -53,23 +53,23 @@ func (env *TravisEnvironment) getMinio() error {
msg("downloading %v\n", url)
res, err := http.Get(url)
if err != nil {
return fmt.Errorf("error downloading minio server: %v\n", err)
return fmt.Errorf("error downloading minio server: %v", err)
}
_, err = io.Copy(tempfile, res.Body)
if err != nil {
return fmt.Errorf("error saving minio server to file: %v\n", err)
return fmt.Errorf("error saving minio server to file: %v", err)
}
err = res.Body.Close()
if err != nil {
return fmt.Errorf("error closing HTTP download: %v\n", err)
return fmt.Errorf("error closing HTTP download: %v", err)
}
err = tempfile.Close()
if err != nil {
msg("closing tempfile failed: %v\n", err)
return fmt.Errorf("error closing minio server file: %v\n", err)
return fmt.Errorf("error closing minio server file: %v", err)
}
err = os.Chmod(tempfile.Name(), 0755)
@ -338,12 +338,12 @@ func findImports() (map[string][]string, error) {
func runGofmt() error {
dir, err := os.Getwd()
if err != nil {
return fmt.Errorf("Getwd(): %v\n", err)
return fmt.Errorf("Getwd(): %v", err)
}
files, err := findGoFiles(dir)
if err != nil {
return fmt.Errorf("error finding Go files: %v\n", err)
return fmt.Errorf("error finding Go files: %v", err)
}
msg("runGofmt() with %d files\n", len(files))
@ -353,11 +353,11 @@ func runGofmt() error {
buf, err := cmd.Output()
if err != nil {
return fmt.Errorf("error running gofmt: %v\noutput: %s\n", err, buf)
return fmt.Errorf("error running gofmt: %v\noutput: %s", err, buf)
}
if len(buf) > 0 {
return fmt.Errorf("not formatted with `gofmt`:\n%s\n", buf)
return fmt.Errorf("not formatted with `gofmt`:\n%s", buf)
}
return nil
@ -369,7 +369,7 @@ func runGlyphcheck() error {
buf, err := cmd.Output()
if err != nil {
return fmt.Errorf("error running glyphcheck: %v\noutput: %s\n", err, buf)
return fmt.Errorf("error running glyphcheck: %v\noutput: %s", err, buf)
}
return nil