If i have created a file in my main()
function:
output, err := os.Create("D:\\output.txt")
And i want everything that another function in the program prints, to be put in that file using:
output.WriteString(str)
How could i pass a pointer to that file so that function could write to it?
Also, is there any other way i should use to write a string to a file, or WriteString
is succicient?
Thanks!