Merge pull request #827 from jmorganca/mxyng/template-adapters

model: native gotemplate adapter template
This commit is contained in:
Michael Yang 2023-10-18 13:11:25 -07:00 committed by GitHub
commit 627d04d927
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -955,11 +955,12 @@ TEMPLATE """{{ .Template }}"""
{{- if .System }}
SYSTEM """{{ .System }}"""
{{- end }}
{{- range $adapter := .AdapterPaths }}
ADAPTER {{ $adapter }}
{{- end }}
{{ .Params }}
`
for _, l := range mt.Model.AdapterPaths {
modelFile += fmt.Sprintf("ADAPTER %s\n", l)
}
tmpl, err := template.New("").Parse(modelFile)
if err != nil {