DEV Community

Discussion on: Arrays and Loops in Go

Collapse
 
rof20004 profile image
Rodolfo Azevedo • Edited

Instead a loop, you can use strings package, like this:

log.Printf("I have %d hobbies, and they are: %s", len(hobbies), strings.Join(hobbies, ", "))
Collapse
 
devdrake0 profile image
Si

You could, but the whole point of this article is to show people arrays and loops.

Not having a loop is therefore pointless.