Skip to content

Commit

Permalink
Merge pull request #164 from karldoenitz/feature-v2.0.1
Browse files Browse the repository at this point in the history
Feature v2.0.1
  • Loading branch information
karldoenitz authored Dec 4, 2024
2 parents 5987e8c + a57e878 commit 416b507
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion web/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/karldoenitz/Tigo/logger"
"gorm.io/gorm"
"html/template"
"io"
"io/ioutil"
"net/http"
"net/http/httputil"
Expand Down Expand Up @@ -42,7 +43,7 @@ func (baseHandler *BaseHandler) InitHandler(responseWriter http.ResponseWriter,
// GetBody 获取HTTP报文体
func (baseHandler *BaseHandler) GetBody() []byte {
if _, ok := baseHandler.ctxValMap["body"]; !ok {
body, err := ioutil.ReadAll(baseHandler.Request.Body)
body, err := io.ReadAll(baseHandler.Request.Body)
if err != nil {
logger.Error.Println(err.Error())
return nil
Expand Down
5 changes: 2 additions & 3 deletions web/struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"github.com/karldoenitz/Tigo/logger"
"gopkg.in/yaml.v2"
"io/ioutil"
"net/http"
"os"
"reflect"
Expand Down Expand Up @@ -165,7 +164,7 @@ func (globalConfig *GlobalConfig) Init(configPath string) {

// 根据yaml文件进行配置
func (globalConfig *GlobalConfig) initWithYaml(configPath string) {
raw, err := ioutil.ReadFile(configPath)
raw, err := os.ReadFile(configPath)
if err != nil {
fmt.Println(err.Error())
os.Exit(1)
Expand All @@ -180,7 +179,7 @@ func (globalConfig *GlobalConfig) initWithYaml(configPath string) {

// 根据json文件进行配置
func (globalConfig *GlobalConfig) initWithJson(configPath string) {
raw, err := ioutil.ReadFile(configPath)
raw, err := os.ReadFile(configPath)
if err != nil {
fmt.Println(err.Error())
os.Exit(1)
Expand Down

0 comments on commit 416b507

Please sign in to comment.