mirror of
https://github.com/golang/go.git
synced 2025-05-05 23:53:05 +00:00
go.tools/present: correctly test empty argument
Updates golang/go#7613. LGTM=r R=r CC=golang-codereviews https://golang.org/cl/105130046
This commit is contained in:
parent
53915e22e2
commit
6251f07ecd
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user