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