code: func DumpReaderToFile(reader io.Reader, filename string) error {
  	f, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0600)
  	if err != nil {
  		return err
  	}
  	defer f.Close()
  
  	buffer := make([]byte, 1024)
  	for {
  		count, err := reader.Read(buffer)
  		if err == io.EOF {
  			break
  		}
  		if err != nil {
  			return err
  		}
  		_, err = f.Write(buffer[:count])
  		if err != nil {
  			return err
  		}
  	}
  	return nil
  }
docs: // DumpReaderToFile writes all data from the given io.Reader to the specified file
  // (usually for temporary use).