code: func (s *Filesystem) WriteState(state *states.State) error {
  	// TODO: this should use a more robust method of writing state, by first
  	// writing to a temp file on the same filesystem, and renaming the file over
  	// the original.
  
  	defer s.mutex()()
  
  	if s.readFile == nil {
  		err := s.refreshState()
  		if err != nil {
  			return err
  		}
  	}
  
  	return s.writeState(state, nil)
  }
docs: // WriteState is an incorrect implementation of Writer that actually also
  // persists.