mirror of https://github.com/golang/go.git
[release-branch.go1.4] cmd/go: fix build
««« CL 182480043 / 8d42099cdc23 cmd/go: fix build The new semantics of split require the newline be present. The test was stale. LGTM=adg R=golang-codereviews, adg CC=golang-codereviews https://golang.org/cl/182480043 »»» TBR=r CC=golang-codereviews https://golang.org/cl/178690043
This commit is contained in:
parent
7aead4c6fd
commit
59730b3343
|
|
@ -250,7 +250,7 @@ func isGoGenerate(buf []byte) bool {
|
|||
|
||||
// split breaks the line into words, evaluating quoted
|
||||
// strings and evaluating environment variables.
|
||||
// The initial //go:generate element is dropped.
|
||||
// The initial //go:generate element is present in line.
|
||||
func (g *Generator) split(line string) []string {
|
||||
// Parse line, obeying quoted strings.
|
||||
var words []string
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ func TestGenerateCommandParse(t *testing.T) {
|
|||
}
|
||||
g.setShorthand([]string{"-command", "yacc", "go", "tool", "yacc"})
|
||||
for _, test := range splitTests {
|
||||
got := g.split("//go:generate " + test.in)
|
||||
got := g.split("//go:generate " + test.in + "\n")
|
||||
if !reflect.DeepEqual(got, test.out) {
|
||||
t.Errorf("split(%q): got %q expected %q", test.in, got, test.out)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue