oh-my-url/app/utils/templates.go
2024-01-19 16:11:54 +04:00

20 lines
334 B
Go

package utils
import (
"os"
"path/filepath"
)
func GetTemplatePaths(filenames ...string) []string {
dir, err := os.Getwd()
if err != nil {
panic(err)
}
templatePath := filepath.Join(dir, "app", "templates")
for i, filename := range filenames {
filenames[i] = filepath.Join(templatePath, filename)
}
return filenames
}