code: func TemporaryFile(scratchDir string, name string) (*os.File, error) {
  	workingDir, err := os.Getwd()
  	if nil != err {
  		return nil, err
  	}
  
  	// Use a stable temporary name
  	temporaryPath := filepath.Join(workingDir, scratchDir, name)
  	buildDir := filepath.Dir(temporaryPath)
  	mkdirErr := os.MkdirAll(buildDir, os.ModePerm)
  	if nil != mkdirErr {
  		return nil, mkdirErr
  	}
  
  	tmpFile, err := os.Create(temporaryPath)
  	if err != nil {
  		return nil, errors.New("Failed to create temporary file: " + err.Error())
  	}
  
  	return tmpFile, nil
  }
docs: // TemporaryFile creates a stable temporary filename in the current working
  // directory