code: func (w *writer) Commit() error {
  
  	if err := w.checkClosed(); err != nil {
  		return err
  	}
  	w.closed = true
  
  	// no session started yet just perform a simple upload
  	if w.sessionURI == "" {
  		err := retry(func() error {
  			wc := storage.NewWriter(cloud.NewContext(dummyProjectID, w.client), w.bucket, w.name)
  			wc.ContentType = "application/octet-stream"
  			return putContentsClose(wc, w.buffer[0:w.buffSize])
  		})
  		if err != nil {
  			return err
  		}
  		w.size = w.offset + int64(w.buffSize)
  		w.buffSize = 0
  		return nil
  	}
  	size := w.offset + int64(w.buffSize)
  	var nn int
  	// loop must be performed at least once to ensure the file is committed even when
  	// the buffer is empty
  	for {
  		n, err := putChunk(w.client, w.sessionURI, w.buffer[nn:w.buffSize], w.offset, size)
  		nn += int(n)
  		w.offset += n
  		w.size = w.offset
  		if err != nil {
  			w.buffSize = copy(w.buffer, w.buffer[nn:w.buffSize])
  			return err
  		}
  		if nn == w.buffSize {
  			break
  		}
  	}
  	w.buffSize = 0
  	return nil
  }
docs: // Commit flushes all content written to this FileWriter and makes it
  // available for future calls to StorageDriver.GetContent and
  // StorageDriver.Reader.