From 3493eee91942306dda0d8b490c25809702679598 Mon Sep 17 00:00:00 2001 From: xing Date: Thu, 1 Jun 2023 22:46:59 +0800 Subject: [PATCH] fix --- app/pkg/config/config.go | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/app/pkg/config/config.go b/app/pkg/config/config.go index 2a299f4..69a4e6f 100644 --- a/app/pkg/config/config.go +++ b/app/pkg/config/config.go @@ -1,7 +1,6 @@ package config import ( - "encoding/json" "fmt" "github.com/fthvgb1/wp-go/safety" "gopkg.in/yaml.v2" @@ -112,20 +111,6 @@ func InitConfig(conf string) error { return nil } -func jsonToYaml[T any](b []byte, c T) error { - var v map[string]any - err := json.Unmarshal(b, &v) - if err != nil { - return err - } - marshal, er := yaml.Marshal(v) - if er != nil { - return er - } - err = yaml.Unmarshal(marshal, c) - return err -} - type Dsn struct { Host string `yaml:"host" json:"host,omitempty"` Port string `yaml:"port" json:"port,omitempty"`