code: func ParseDuration(s string) (d time.Duration, err error) {
  	r := strings.NewReader(s)
  
  	switch {
  	case strings.HasSuffix(s, "d"):
  		var v float64
  		_, err = fmt.Fscanf(r, "%fd", &v)
  		d = time.Duration(v * float64(24*time.Hour))
  	case strings.HasSuffix(s, "w"):
  		var v float64
  		_, err = fmt.Fscanf(r, "%fw", &v)
  		d = time.Duration(v * float64(24*time.Hour*7))
  	case strings.HasSuffix(s, "mo"):
  		var v float64
  		_, err = fmt.Fscanf(r, "%fmo", &v)
  		d = time.Duration(v * float64(30*24*time.Hour))
  	case strings.HasSuffix(s, "M"):
  		var v float64
  		_, err = fmt.Fscanf(r, "%fM", &v)
  		d = time.Duration(v * float64(30*24*time.Hour))
  	default:
  		d, err = time.ParseDuration(s)
  	}
  
  	return
  }
docs: // ParseDuration string with day and month approximation support.