MCPcopy Index your code
hub / github.com/go-dev-frame/sponge / getModelCode

Function getModelCode

pkg/sql2code/parser/parser.go:851–864  ·  view source on GitHub ↗
(data modelCodes)

Source from the content-addressed store, hash-verified

849}
850
851func getModelCode(data modelCodes) (string, error) {
852 builder := strings.Builder{}
853 err := modelTmpl.Execute(&builder, data)
854 if err != nil {
855 return "", err
856 }
857
858 code, err := format.Source([]byte(builder.String()))
859 if err != nil {
860 return "", fmt.Errorf("getModelCode format.Source error: %v", err)
861 }
862
863 return string(code), nil
864}
865
866func getUpdateFieldsCode(data tmplData, isEmbed bool) (string, error) {
867 _ = isEmbed

Callers 1

ParseSQLFunction · 0.70

Calls 3

ErrorfMethod · 0.80
ExecuteMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected