blob: 269446725a27f4a0c8f18b047b733e5663d832d3 [file] [log] [blame]
package main
import (
"fmt"
)
// The playground now supports parentheses or square brackets (only one at
// a time) for generic type and function declarations and instantiations.
// By default, parentheses are expected. To switch to square brackets,
// the first generic declaration in the source must use square brackets.
func Print[type T](s []T) {
for _, v := range s {
fmt.Print(v)
}
}
func main() {
Print([]string{"Hello, ", "playground\n"})
}