title: Go: Write carriage return with IO
body: <p>I'm trying to write on a file in Go with IO.WriteString, but even writing "\n" character it does not print the carriage return. I think maybe is not the carriage return itself what i need to write, in Windows, if i open the txt file with Wordpad, the carriage return is shown, but not in the notepad.</p>
  
  <p>Any ideas about this behaviour?, here is the code:</p>
  
  <pre><code>//Write
  t := time.Now().Local()
  src, err := os.Stat("/dir")
  if err != nil {
      log.Println(err, log.Llongfile)
  }
  if !src.IsDir() {
      err = errors.New("Folder does not exists")
      log.Println(err, log.Llongfile)
      err = os.MkdirAll("/dir", 665)
      log.Println(err, log.Llongfile)
  }
  f, err := os.Create("/dir" + "/File_" + t.Format("20060102") + ".txt")
  n, err := io.WriteString(f, "Hello World\n")
  n, err = io.WriteString(f, "Goodbye\n")
  </code></pre>
  
  <p>With this code, the result in the txt file is "Hello WorldGoodbye" if i open it in Windows notepad.</p>
  
  <p>Thanks.</p>