code: func WriteEnvFile(env []string, uidRange *user.UidRange, envFilePath string) error {
  	ef := bytes.Buffer{}
  
  	for _, v := range env {
  		fmt.Fprintf(&ef, "%s\n", v)
  	}
  
  	if err := os.MkdirAll(filepath.Dir(envFilePath), 0755); err != nil {
  		return err
  	}
  
  	if err := ioutil.WriteFile(envFilePath, ef.Bytes(), 0644); err != nil {
  		return err
  	}
  
  	if err := user.ShiftFiles([]string{envFilePath}, uidRange); err != nil {
  		return err
  	}
  
  	return nil
  }
docs: // WriteEnvFile creates an environment file for given app name.  To
  // ensure the minimum required environment variables by the appc spec
  // are set to sensible defaults, env should be the result of calling
  // ComposeEnviron.  The containing directory and its ancestors will be
  // created if necessary.