{"record":{"id":"9cf8607ccc231637","repo":"zeromicro/go-zero","slug":"secret-s-length-can-t-be-less-than-8","errorCode":null,"errorMessage":"secret's length can't be less than 8","messagePattern":"secret's length can't be less than 8","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rest/server.go","lineNumber":339,"sourceCode":"func WithUnsignedCallback(callback handler.UnsignedCallback) RunOption {\n\treturn func(svr *Server) {\n\t\tsvr.ngin.setUnsignedCallback(callback)\n\t}\n}\n\nfunc handleError(err error) {\n\t// ErrServerClosed means the server is closed manually\n\tif err == nil || errors.Is(err, http.ErrServerClosed) {\n\t\treturn\n\t}\n\n\tlogx.Error(err)\n\tpanic(err)\n}\n\nfunc validateSecret(secret string) {\n\tif len(secret) < 8 {\n\t\tpanic(\"secret's length can't be less than 8\")\n\t}\n}\n\ntype corsRouter struct {\n\thttpx.Router\n\tmiddleware Middleware\n}\n\nfunc newCorsRouter(router httpx.Router, headerFn func(http.Header), origins ...string) httpx.Router {\n\treturn &corsRouter{\n\t\tRouter:     router,\n\t\tmiddleware: cors.Middleware(headerFn, origins...),\n\t}\n}\n\nfunc (c *corsRouter) ServeHTTP(w http.ResponseWriter, r *http.Request) {\n\tc.middleware(c.Router.ServeHTTP)(w, r)\n}","sourceCodeStart":321,"sourceCodeEnd":357,"githubUrl":"https://github.com/zeromicro/go-zero/blob/11f21098ddd95a58f801920fea4f0543d4d01586/rest/server.go#L321-L357","documentation":"Error \"secret's length can't be less than 8\" thrown in zeromicro/go-zero.","triggerScenarios":"Thrown at rest/server.go:339 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"11f21098ddd95a58f801920fea4f0543d4d01586","analyzedAt":"2026-08-15T15:59:26.308Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}