code: func write(buf []byte, path string) error {
  	file, err := os.OpenFile(path, os.O_WRONLY, 0600)
  	if err != nil {
  		return err
  	}
  	if _, err := file.Write(buf); err != nil {
  		return err
  	}
  	return file.Close()
  }
docs: // write opens a file for writing, writes the byte slice to it and closes the
  // file.