Use path instead of filepath

master
kts of kettek 2023-07-28 18:33:19 -07:00
parent 98207ec716
commit 01558a3f77
1 changed files with 3 additions and 1 deletions

View File

@ -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