aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/generate.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/go/generate.go')
-rw-r--r--src/cmd/go/generate.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/go/generate.go b/src/cmd/go/generate.go
index 8991fb6af2..3c0af8760b 100644
--- a/src/cmd/go/generate.go
+++ b/src/cmd/go/generate.go
@@ -256,6 +256,10 @@ func (g *Generator) split(line string) []string {
// Parse line, obeying quoted strings.
var words []string
line = line[len("//go:generate ") : len(line)-1] // Drop preamble and final newline.
+ // There may still be a carriage return.
+ if len(line) > 0 && line[len(line)-1] == '\r' {
+ line = line[:len(line)-1]
+ }
// One (possibly quoted) word per iteration.
Words:
for {