Use path instead of filepath
parent
98207ec716
commit
01558a3f77
|
@ -5,11 +5,13 @@ import (
|
|||
"encoding/json"
|
||||
"image"
|
||||
"log"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// FS is our exported FS.
|
||||
//
|
||||
//go:embed images/* mapping.json
|
||||
var fs embed.FS
|
||||
|
||||
|
@ -27,7 +29,7 @@ func Init() {
|
|||
if !e.IsDir() {
|
||||
ext := filepath.Ext(e.Name())
|
||||
name := strings.TrimSuffix(e.Name(), ext)
|
||||
f, err := fs.Open(filepath.Join("./images", e.Name()))
|
||||
f, err := fs.Open(path.Join("images", e.Name()))
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue