code: func (p *PAM) writeStream(stream int, s string) (int, error) {
  	writer := p.stdout
  	if stream == syscall.Stderr {
  		writer = p.stderr
  	}
  
  	// Replace \n with \r\n so the message correctly aligned.
  	r := strings.NewReplacer("\r\n", "\r\n", "\n", "\r\n")
  	n, err := writer.Write([]byte(r.Replace(s)))
  	if err != nil {
  		return n, err
  	}
  
  	return n, nil
  }
docs: // writeStream will write to the output stream (stdout or stderr or
  // equivalent).