As illustrated below, both fmt.Println()
and println()
give same output in Go: Hello world!
But: how do they differ from each
I can see difference here:
rangeOverIntsAndStrings(1, 5)
func rangeOverIntsAndStrings(args ...interface{}) {
for _, v := range args {
println(v)
}
}
// output
(0x108f060,0x10c5358)
(0x108f060,0x10c5360)
vs
func rangeOverIntsAndStrings(args ...interface{}) {
for _, v := range args {
fmt.Println(v)
}
}
// output
1
5