You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When formatting function calls that provide variadic arguments using `slice...`, gofmt
drops "...":
% cat sample.go
package main
func doSomething(args ...string) {
}
func main() {
values := []string{"a", "b"}
doSomething(values...)
}
% gofmt -r 'doSomething(a) -> DoSomething(a)' sample.go
package main
func doSomething(args ...string) {
}
func main() {
values := []string{"a", "b"}
DoSomething(values)
}
It rewrote doSomething(values...) to DoSomething(values), meaning that the code does not
compile anymore.
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: