code: func CopyFileContents(src, dst string) (err error) {
  	in, err := os.Open(src)
  	if err != nil {
  		return
  	}
  	defer in.Close()
  	ext := filepath.Ext(dst)
  	var out *os.File
  	if ext == ".sh" {
  		out, err = os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_EXCL, 0766)
  	} else {
  		out, err = os.Create(dst)
  	}
  	if err != nil {
  		return
  	}
  	defer func() {
  		cerr := out.Close()
  		if err == nil {
  			err = cerr
  		}
  	}()
  	if _, err = io.Copy(out, in); err != nil {
  		return
  	}
  	err = out.Sync()
  	return
  }
docs: // CopyFileContents copies the contents of the file named src to the file named
  // by dst. The file will be created if it does not already exist. If the
  // destination file exists, all it's contents will be replaced by the contents
  // of the source file.
  //
  // From http://stackoverflow.com/a/21067803