如何用字符串切换大小写

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

Your New function must looks like:

func New(value string) Etat {
    switch value {
    case "Recette", "Production":
        return Etat{Value :value}
    default:
        panic("unrecognized value")
    }
}

use double quotes instead of single quote in case expresion

case "Recette":

instead of

case 'Recette':

by the way, better to change your function name from New() to something else