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

Method parseImport

parser/parser.go:669–682  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

667}
668
669func (p *parser) parseImport() error {
670 t, err := expectTagContents(p.s)
671 if err != nil {
672 return err
673 }
674 if len(t.Value) == 0 {
675 return fmt.Errorf("empty import found at %s", p.s.Context())
676 }
677 if err = validateImport(t.Value); err != nil {
678 return fmt.Errorf("invalid import found at %s: %s", p.s.Context(), err)
679 }
680 p.Printf("import %s\n", t.Value)
681 return nil
682}
683
684func (p *parser) parseTemplateCode() error {
685 t, err := expectTagContents(p.s)

Callers 1

parseTemplateMethod · 0.95

Calls 4

PrintfMethod · 0.95
expectTagContentsFunction · 0.85
validateImportFunction · 0.85
ContextMethod · 0.80

Tested by

no test coverage detected