4 ms·
You can mimic that syntax in Go. I don't recommend it but you'd only have to add a function. func it(n int) []struct{} { return make([]struct{}, n)
by aric 11y ago
You can mimic that syntax in Go. I don't recommend it but you'd only have to add a function.
func it(n int) []struct{} {
return make([]struct{}, n)
}
// ex. 1:
for range it(10) {
fmt.Println(".")
}
// ex. 2:
for i := range it(10) {
fmt.Println(i)
}