Skip to content

Commit

Permalink
go.tools/present: correctly test empty argument
Browse files Browse the repository at this point in the history
Updates golang/go#7613.

LGTM=r
R=r
CC=golang-codereviews
https://golang.org/cl/105130046
  • Loading branch information
kortschak authored and robpike committed Jun 12, 2014
1 parent 53915e2 commit 6251f07
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion present/code.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,11 @@ func parseArgs(name string, line int, args []string) (res []interface{}, err err
case '$':
res[i] = "$"
case '_':
// Do nothing; '_' indicates an intentionally empty parameter.
if len(v) == 1 {
// Do nothing; "_" indicates an intentionally empty parameter.
break
}
fallthrough
default:
return nil, fmt.Errorf("%s:%d bad code argument %q", name, line, v)
}
Expand Down

0 comments on commit 6251f07

Please sign in to comment.