mirror of
https://github.com/golang/go.git
synced 2025-05-06 08:03:03 +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 '$':
|
case '$':
|
||||||
res[i] = "$"
|
res[i] = "$"
|
||||||
case '_':
|
case '_':
|
||||||
// Do nothing; '_' indicates an intentionally empty parameter.
|
if len(v) == 1 {
|
||||||
|
// Do nothing; "_" indicates an intentionally empty parameter.
|
||||||
|
break
|
||||||
|
}
|
||||||
|
fallthrough
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("%s:%d bad code argument %q", name, line, v)
|
return nil, fmt.Errorf("%s:%d bad code argument %q", name, line, v)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user