14 lines
315 B
Go
14 lines
315 B
Go
package controller
|
|
|
|
import "strings"
|
|
|
|
// validateTypeName always return v without leading and trailing spaces
|
|
func validateTypeName(v string) (string, bool) {
|
|
s := strings.TrimSpace(v)
|
|
if len(s) > 0 {
|
|
return s, true
|
|
}
|
|
// TODO: special symbols AND include error check in all user-input test
|
|
return s, false
|
|
}
|