diagnostic tool fixes

This commit is contained in:
2024-04-22 13:52:17 +03:00
parent 4f18b6db18
commit dc2e6ea2b5
20 changed files with 178 additions and 160 deletions

View File

@ -1,13 +1,13 @@
package itemprops
import (
"encoding/json"
"fmt"
"github.com/rs/zerolog"
"io/ioutil"
"os"
"path/filepath"
"strings"
"encoding/json"
"fmt"
"os"
"path/filepath"
"strings"
"github.com/rs/zerolog"
)
type Material struct {
@ -50,7 +50,7 @@ func NewMaterialMap(path string, logger zerolog.Logger) (MaterialMap, error) {
if strings.HasSuffix(path, ".json") {
splt := strings.Split(path, "/")
logger.Info().Msgf("loading %s %d", splt[len(splt)-1], info.Size())
bytes, err := ioutil.ReadFile(path)
bytes, err := os.ReadFile(path)
if err != nil {
return err
}
@ -60,7 +60,7 @@ func NewMaterialMap(path string, logger zerolog.Logger) (MaterialMap, error) {
if err != nil {
return err
}
for idx, _ := range ttmp {
for idx := range ttmp {
tmp[idx] = append(tmp[idx], ttmp[idx]...)
}
}