我有以下编译器抱怨的代码。
switch req.Method {
case "POST" || "PUT" || "DELETE":
if req.Header.Get("Content-Type") != "application/json" {
return handleErr(req)
}
}
编译器错误消息
..\..\controllers\routes\header.go:59: invalid operation: "POST" || "PUT" (operator || not defined on string)
我是否以错误的方式使用OR运算符?