MCPcopy
hub / github.com/valyala/quicktemplate / expectToken

Function expectToken

parser/parser.go:841–850  ·  view source on GitHub ↗
(s *scanner, id int)

Source from the content-addressed store, hash-verified

839}
840
841func expectToken(s *scanner, id int) (*token, error) {
842 if !s.Next() {
843 return nil, fmt.Errorf("cannot find token %s: %v", tokenIDToStr(id), s.LastError())
844 }
845 t := s.Token()
846 if t.ID != id {
847 return nil, fmt.Errorf("unexpected token found %s. Expecting %s at %s", t, tokenIDToStr(id), s.Context())
848 }
849 return t, nil
850}
851
852func validateOutputTagValue(stmt []byte) error {
853 exprStr := string(stmt)

Callers 1

expectTagContentsFunction · 0.85

Calls 5

tokenIDToStrFunction · 0.85
NextMethod · 0.80
LastErrorMethod · 0.80
TokenMethod · 0.80
ContextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…