From 1096ef9396e9cca14319c72b2bc79fb49bf72331 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 10 Mar 2026 20:42:23 +0800 Subject: [PATCH] chore: replace ioutil with io/os --- config/configs.go | 4 ++-- config/configset.go | 4 ++-- request.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/configs.go b/config/configs.go index 50a745a..bcd42db 100644 --- a/config/configs.go +++ b/config/configs.go @@ -3,7 +3,7 @@ package config import ( "encoding/xml" "errors" - "io/ioutil" + "os" "github.com/devfeel/dotweb/core" "github.com/devfeel/dotweb/framework/file" @@ -265,7 +265,7 @@ func dealConfigDefaultSet(c *Config) { } func initConfig(configFile string, ctType string, parser func([]byte, interface{}) error) (*Config, error) { - content, err := ioutil.ReadFile(configFile) + content, err := os.ReadFile(configFile) if err != nil { return nil, errors.New("DotWeb:Config:initConfig current cType:" + ctType + " config file [" + configFile + "] cannot be parsed - " + err.Error()) } diff --git a/config/configset.go b/config/configset.go index 8dbb8e3..89b66fb 100644 --- a/config/configset.go +++ b/config/configset.go @@ -3,7 +3,7 @@ package config import ( "encoding/xml" "errors" - "io/ioutil" + "os" "github.com/devfeel/dotweb/core" ) @@ -39,7 +39,7 @@ func ParseConfigSetYaml(configFile string) (core.ConcurrenceMap, error) { } func parseConfigSetFile(configFile string, confType string) (core.ConcurrenceMap, error) { - content, err := ioutil.ReadFile(configFile) + content, err := os.ReadFile(configFile) if err != nil { return nil, errors.New("DotWeb:Config:parseConfigSetFile 配置文件[" + configFile + ", " + confType + "]无法解析 - " + err.Error()) } diff --git a/request.go b/request.go index 2a714cb..87b1dda 100644 --- a/request.go +++ b/request.go @@ -1,7 +1,7 @@ package dotweb import ( - "io/ioutil" + "io" "net" "net/http" "net/url" @@ -162,7 +162,7 @@ func (req *Request) PostBody() []byte { break } } - bts, err := ioutil.ReadAll(req.Body) + bts, err := io.ReadAll(req.Body) if err != nil { //if err, panic it panic(err)