Here is my code:
type Etat struct {
gorm.Model
Value string `form:"value"`
}
func New(value string) Etat {
switch value {
case 'Recette':
return Etat{Value :value}
case 'Production':
return Etat{Value :value}
default:
panic("unrecognized value")
}
}
And here is the error that I got :
.\MicroConf.go:23:2: invalid case '\u0000' in switch on value (mismatched types rune and string)
.\MicroConf.go:23:7: invalid character literal (more than one character)
.\MicroConf.go:25:2: invalid case '\u0000' in switch on value (mismatched types rune and string)
.\MicroConf.go:25:2: duplicate case '\u0000' (value 0) in switch
previous case at .\MicroConf.go:23:7
.\MicroConf.go:25:7: invalid character literal (more than one character)
I truly don't understand how it's not working. I'm trying to follow this tutorial