// checkName checks model definition and trained model is valid.
checkName checks model definition and trained model is valid.
// checkName checks model definition and trained model is valid .
func checkName(name string) error {
	if len(name) < 6 {
		return fmt.Errorf("model name should have at least 6 characters")
	}
	match, err := regexp.MatchString(`^[a-zA-Z0-9_\-]{6,256}$`, name)
	if err != nil {
		return err
	}
	if !match {
		return fmt.Errorf("model name should be constist of letters, numbers, underscroll, dash, and must start with a letter")
	}
	return nil
}
func checkName ( name string ) error { if len ( name ) < 6 { return fmt . Errorf ( " " ) } match , err := regexp . MatchString ( `^[a-zA-Z0-9_\-]{6,256}$` , name ) if err != nil { return err } if ! match { return fmt . Errorf ( " " ) } return nil }
checkName checks model definition and trained model is valid.
checkName checks model definition and trained model is valid .