Currently, to represent a newline in go programs, I use \\n
. For example:
package main
import \"fmt\"
func main() {
fmt.Printf(\"%d is %s
Having the OS determine what the newline character is happens in many contexts to be wrong. What you are really want to know is what the "record" seperator is and Go assumes that you as the programmer should know that.
Even if the binary runs on windows it may be consuming a file from a Unix OS.
Line endings are determined by what the source of the file or document said was a line ending not the OS the binary is running in.