os.ReadFile

This commit is contained in:
BuckarooBanzay 2023-01-20 18:04:27 +01:00
parent a4bd231cec
commit 201d983ac0
5 changed files with 7 additions and 9 deletions

View File

@ -2,7 +2,6 @@ package app
import (
"encoding/json"
"io/ioutil"
"mapserver/layer"
"os"
"runtime"
@ -132,7 +131,7 @@ func ParseConfig(filename string) (*Config, error) {
info, err := os.Stat(filename)
if info != nil && err == nil {
data, err := ioutil.ReadFile(filename)
data, err := os.ReadFile(filename)
if err != nil {
return nil, err
}

View File

@ -19,7 +19,6 @@ import (
"github.com/minetest-go/colormapping"
"io/ioutil"
"os"
"github.com/sirupsen/logrus"
@ -104,7 +103,7 @@ func Setup(p params.ParamsType, cfg *Config) *App {
if info != nil && err == nil {
logrus.WithFields(logrus.Fields{"filename": "colors.txt"}).Info("Loading colors from filesystem")
data, err := ioutil.ReadFile("colors.txt")
data, err := os.ReadFile("colors.txt")
if err != nil {
panic(err)
}

View File

@ -3,7 +3,7 @@ package areasparser
import (
"bytes"
"encoding/json"
"io/ioutil"
"os"
)
type GenericPos struct {
@ -41,7 +41,7 @@ func (pos *GenericPos) UnmarshalJSON(data []byte) error {
}
func ParseFile(filename string) ([]*Area, error) {
content, err := ioutil.ReadFile(filename)
content, err := os.ReadFile(filename)
if err != nil {
return nil, err
}

View File

@ -46,7 +46,7 @@ func (this *TileDB) GetTile(pos *coords.TileCoords) ([]byte, error) {
_, file := this.getDirAndFile(pos)
info, _ := os.Stat(file)
if info != nil {
content, err := ioutil.ReadFile(file)
content, err := os.ReadFile(file)
if err != nil {
panic(err)
}

View File

@ -3,8 +3,8 @@ package travelnetparser
import (
"errors"
"fmt"
"io/ioutil"
"mapserver/luaparser"
"os"
)
type GenericPos struct {
@ -19,7 +19,7 @@ type Travelnet struct {
}
func ParseFile(filename string) (map[string]map[string]map[string]*Travelnet, error) {
content, err := ioutil.ReadFile(filename)
content, err := os.ReadFile(filename)
if err != nil {
return nil, err
}