code: func WriteGoroutineStacksToFile(path string) error {
  	f, err := os.OpenFile(path, os.O_CREATE|os.O_WRONLY, 0666)
  	if err != nil {
  		return err
  	}
  	defer f.Close()
  	defer f.Sync()
  
  	return WriteGoroutineStacks(f)
  }
docs: // WriteGoroutineStacksToFile write goroutine stacks
  // to the specified file.