schema/field: add option to set the Go identifier for enums (#635)

This commit is contained in:
Ariel Mashraki
2020-07-22 20:22:24 +03:00
committed by GitHub
parent 5ad267d862
commit daaa9f2db1
34 changed files with 587 additions and 84 deletions

View File

@@ -101,7 +101,7 @@ func (s State) String() string {
return string(s)
}
// StateValidator is a validator for the "s" field enum values. It is called by the builders before save.
// StateValidator is a validator for the "state" field enum values. It is called by the builders before save.
func StateValidator(s State) error {
switch s {
case StateLoggedIn, StateLoggedOut:

View File

@@ -105,7 +105,7 @@ func (s State) String() string {
return string(s)
}
// StateValidator is a validator for the "s" field enum values. It is called by the builders before save.
// StateValidator is a validator for the "state" field enum values. It is called by the builders before save.
func StateValidator(s State) error {
switch s {
case StateLoggedIn, StateLoggedOut, StateOnline:
@@ -128,7 +128,7 @@ func (s Status) String() string {
return string(s)
}
// StatusValidator is a validator for the "s" field enum values. It is called by the builders before save.
// StatusValidator is a validator for the "status" field enum values. It is called by the builders before save.
func StatusValidator(s Status) error {
switch s {
case StatusDone, StatusPending: