code: func (ss *FileSubStore) lockFile() error {
  	wasOpened, err := ss.fm.lockFile(ss.file)
  	if err != nil {
  		return err
  	}
  	// If file was not opened, we need to reset ss.writer
  	if !wasOpened {
  		if ss.bw != nil {
  			ss.writer = ss.bw.createNewWriter(ss.file.handle)
  		} else {
  			ss.writer = ss.file.handle
  		}
  	}
  	return nil
  }
docs: // getFile ensures that the store's file handle is valid, opening
  // the file if needed. If file needs to be opened, the store's writer
  // is set to either the bare file or the buffered writer (based on
  // store's configuration).