code: func UnitFromDuration(d time.Duration) (Unit, error) {
  	if unit, found := durationsToUnit[d]; found {
  		return unit, nil
  	}
  
  	return None, errConvertDurationToUnit
  }
docs: // UnitFromDuration creates a time unit from a time duration.