mirror of https://github.com/tidwall/tile38.git
varadic optional arguments, #213
This commit is contained in:
parent
9cdbea19c1
commit
e71c7af21b
|
@ -105,7 +105,11 @@ func (a Argument) String() string {
|
|||
subs = strings.TrimSpace(subs)
|
||||
s += " " + subs
|
||||
if a.Variadic {
|
||||
s += " [" + subs + " ...]"
|
||||
if len(names) == 0 {
|
||||
s += " [" + subs + " ...]"
|
||||
} else {
|
||||
s += " [" + names[len(names)-1] + " ...]"
|
||||
}
|
||||
}
|
||||
if a.Multiple {
|
||||
s += " ..."
|
||||
|
|
|
@ -105,7 +105,11 @@ func (a Argument) String() string {
|
|||
subs = strings.TrimSpace(subs)
|
||||
s += " " + subs
|
||||
if a.Variadic {
|
||||
s += " [" + subs + " ...]"
|
||||
if len(names) == 0 {
|
||||
s += " [" + subs + " ...]"
|
||||
} else {
|
||||
s += " [" + names[len(names)-1] + " ...]"
|
||||
}
|
||||
}
|
||||
if a.Multiple {
|
||||
s += " ..."
|
||||
|
|
Loading…
Reference in New Issue