MCPcopy Create free account
hub / github.com/appleboy/CodeGPT / LoadTemplatesFromDir

Function LoadTemplatesFromDir

util/template.go:76–78  ·  view source on GitHub ↗

LoadTemplatesFromDir loads all the templates found in the specified directory from the filesystem. It returns an error if reading the directory or parsing any template fails.

(dir string)

Source from the content-addressed store, hash-verified

74// LoadTemplatesFromDir loads all the templates found in the specified directory from the filesystem.
75// It returns an error if reading the directory or parsing any template fails.
76func LoadTemplatesFromDir(dir string) error {
77 return loadTemplatesFromFS(os.DirFS(dir), ".")
78}
79
80// loadTemplatesFromFS is a helper function that loads templates from the given filesystem and directory.
81// It returns an error if reading the directory or parsing any template fails.

Callers 2

checkFunction · 0.92
TestLoadTemplatesFromDirFunction · 0.85

Calls 1

loadTemplatesFromFSFunction · 0.85

Tested by 1

TestLoadTemplatesFromDirFunction · 0.68