code: func ShortHumanDuration(d time.Duration) string {
  	// Allow deviation no more than 2 seconds(excluded) to tolerate machine time
  	// inconsistence, it can be considered as almost now.
  	if seconds := int(d.Seconds()); seconds < -1 {
  		return fmt.Sprintf("<invalid>")
  	} else if seconds < 0 {
  		return fmt.Sprintf("0s")
  	} else if seconds < 60 {
  		return fmt.Sprintf("%ds", seconds)
  	} else if minutes := int(d.Minutes()); minutes < 60 {
  		return fmt.Sprintf("%dm", minutes)
  	} else if hours := int(d.Hours()); hours < 24 {
  		return fmt.Sprintf("%dh", hours)
  	} else if hours < 24*365 {
  		return fmt.Sprintf("%dd", hours/24)
  	}
  	return fmt.Sprintf("%dy", int(d.Hours()/24/365))
  }
docs: // ShortHumanDuration returns a succint representation of the provided duration
  // with limited precision for consumption by humans.