]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: add missing newlines in printf formats
authorDaniel Martí <mvdan@mvdan.cc>
Sun, 19 Aug 2018 14:58:35 +0000 (15:58 +0100)
committerIan Lance Taylor <iant@golang.org>
Mon, 20 Aug 2018 03:32:43 +0000 (03:32 +0000)
These are all errors given by module-aware cmd/go, so they must end with
a newline. It looks like they were omitted by mistake.

Fixes #27081.

Change-Id: I19b5803bb48a6d5dd52e857f483278fe20fe246b
Reviewed-on: https://go-review.googlesource.com/129780
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go/internal/modfile/rule.go

index f669575c860e86501f0bf16b0c5ea1b86dc5423b..e11f0a6e31e152d1f887aff6dd5f82d556ab3b40 100644 (file)
@@ -250,7 +250,7 @@ func (f *File) add(errs *bytes.Buffer, line *Line, verb string, args []string, f
                        arrow = 1
                }
                if len(args) < arrow+2 || len(args) > arrow+3 || args[arrow] != "=>" {
-                       fmt.Fprintf(errs, "%s:%d: usage: %s module/path [v1.2.3] => other/module v1.4\n\t or %s module/path [v1.2.3] => ../local/directory", f.Syntax.Name, line.Start.Line, verb, verb)
+                       fmt.Fprintf(errs, "%s:%d: usage: %s module/path [v1.2.3] => other/module v1.4\n\t or %s module/path [v1.2.3] => ../local/directory\n", f.Syntax.Name, line.Start.Line, verb, verb)
                        return
                }
                s, err := parseString(&args[0])
@@ -287,11 +287,11 @@ func (f *File) add(errs *bytes.Buffer, line *Line, verb string, args []string, f
                nv := ""
                if len(args) == arrow+2 {
                        if !IsDirectoryPath(ns) {
-                               fmt.Fprintf(errs, "%s:%d: replacement module without version must be directory path (rooted or starting with ./ or ../)", f.Syntax.Name, line.Start.Line)
+                               fmt.Fprintf(errs, "%s:%d: replacement module without version must be directory path (rooted or starting with ./ or ../)\n", f.Syntax.Name, line.Start.Line)
                                return
                        }
                        if filepath.Separator == '/' && strings.Contains(ns, `\`) {
-                               fmt.Fprintf(errs, "%s:%d: replacement directory appears to be Windows path (on a non-windows system)", f.Syntax.Name, line.Start.Line)
+                               fmt.Fprintf(errs, "%s:%d: replacement directory appears to be Windows path (on a non-windows system)\n", f.Syntax.Name, line.Start.Line)
                                return
                        }
                }
@@ -303,7 +303,7 @@ func (f *File) add(errs *bytes.Buffer, line *Line, verb string, args []string, f
                                return
                        }
                        if IsDirectoryPath(ns) {
-                               fmt.Fprintf(errs, "%s:%d: replacement module directory path %q cannot have version", f.Syntax.Name, line.Start.Line, ns)
+                               fmt.Fprintf(errs, "%s:%d: replacement module directory path %q cannot have version\n", f.Syntax.Name, line.Start.Line, ns)
                                return
                        }
                }