code: func (s *State) refreshState() error {
  	payload, err := s.Client.Get()
  	if err != nil {
  		return err
  	}
  
  	// no remote state is OK
  	if payload == nil {
  		s.readState = nil
  		s.lineage = ""
  		s.serial = 0
  		return nil
  	}
  
  	stateFile, err := statefile.Read(bytes.NewReader(payload.Data))
  	if err != nil {
  		return err
  	}
  
  	s.lineage = stateFile.Lineage
  	s.serial = stateFile.Serial
  	s.state = stateFile.State
  	s.readState = s.state.DeepCopy() // our states must be separate instances so we can track changes
  	return nil
  }
docs: // refreshState is the main implementation of RefreshState, but split out so
  // that we can make internal calls to it from methods that are already holding
  // the s.mu lock.