code: func (a *Amount) GetAmount(now time.Time) (int32, error) {
  	for _, s := range a.GetChange() {
  		start, err := s.mostRecentStart(now)
  		if err != nil {
  			return 0, errors.Annotate(err, "invalid start time").Err()
  		}
  		if start.Before(now) || start.Equal(now) {
  			sec, err := s.Length.ToSeconds()
  			if err != nil {
  				return 0, errors.Annotate(err, "invalid length").Err()
  			}
  			end := start.Add(time.Second * time.Duration(sec))
  			if now.Before(end) {
  				return s.Amount, nil
  			}
  		}
  	}
  	return a.GetDefault(), nil
  }
docs: // GetAmount returns the amount to use at the given time. Returns the first
  // matching amount, which should be the only match if this *Amount has been
  // validated.