Comment

Comment by aric

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) 
    }
parent aric 11 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton