code: func CheckName(stat string) error {
  	if !safeName.MatchString(stat) {
  		return fmt.Errorf("invalid stat name: %s", stat)
  	}
  	return nil
  }
docs: // CheckName may be used to validate whether a stat name contains invalid
  // characters. If invalid characters are found, the function will return an
  // error.