is there any way to store each element of slice on new line ? something like this :
1
2
3
instead of
1 2 3
i just dont want to print these elements on new line but want to store elements each on separate line
here is the code:
package main
import "fmt"
func main() {
slice := []int{1, 2, 3}
fmt.Println(slice)
}
Thanks