use filepath.Join wrapper for different embed and os path styles
If using internal, "/" is used as a separator always, and with external, filepath.Join is used.
This commit is contained in:
@@ -29,7 +29,7 @@ func (app *appContext) loadHTML(router *gin.Engine) {
|
||||
for i, f := range htmlFiles {
|
||||
if _, err := os.Stat(filepath.Join(customPath, f.Name())); os.IsNotExist(err) {
|
||||
app.debug.Printf("Using default \"%s\"", f.Name())
|
||||
loadFiles[i] = filepath.Join(templatePath, f.Name())
|
||||
loadFiles[i] = FSJoin(templatePath, f.Name())
|
||||
} else {
|
||||
app.info.Printf("Using custom \"%s\"", f.Name())
|
||||
loadFiles[i] = filepath.Join(filepath.Join(customPath, f.Name()))
|
||||
|
||||
Reference in New Issue
Block a user