MCPcopy Index your code
hub / github.com/zeromicro/go-zero / checkTypeContext

Method checkTypeContext

tools/goctl/pkg/parser/api/parser/api.go:187–200  ·  view source on GitHub ↗
(declareContext map[string]placeholder.Type)

Source from the content-addressed store, hash-verified

185}
186
187func (api *API) checkTypeContext(declareContext map[string]placeholder.Type) error {
188 var em = newErrorManager()
189 for _, v := range api.TypeStmt {
190 switch tp := v.(type) {
191 case *ast.TypeLiteralStmt:
192 em.add(api.checkTypeExprContext(declareContext, tp.Expr.DataType))
193 case *ast.TypeGroupStmt:
194 for _, v := range tp.ExprList {
195 em.add(api.checkTypeExprContext(declareContext, v.DataType))
196 }
197 }
198 }
199 return em.error()
200}
201
202func (api *API) checkTypeExprContext(declareContext map[string]placeholder.Type, tp ast.DataType) error {
203 switch val := tp.(type) {

Callers 1

Calls 4

checkTypeExprContextMethod · 0.95
newErrorManagerFunction · 0.85
addMethod · 0.65
errorMethod · 0.45

Tested by

no test coverage detected