code: func (r *EtcdRegistry) getUnitState(uName, machID string) (*unit.UnitState, error) {
  	key := r.unitStatePath(machID, uName)
  	res, err := r.kAPI.Get(context.Background(), key, nil)
  	if err != nil {
  		if isEtcdError(err, etcd.ErrorCodeKeyNotFound) {
  			err = nil
  		}
  		return nil, err
  	}
  
  	var usm unitStateModel
  	if err := unmarshal(res.Node.Value, &usm); err != nil {
  		return nil, err
  	}
  
  	return modelToUnitState(&usm, uName), nil
  }
docs: // getUnitState retrieves the current UnitState, if any exists, for the
  // given unit that originates from the indicated machine