diff --git a/config.go b/config.go index c4c82f3..b40f02e 100644 --- a/config.go +++ b/config.go @@ -10,7 +10,7 @@ import ( "os" "runtime" - "gopkg.in/yaml.v2" + "gopkg.in/yaml.v3" ) // build info, assign by compile time or runtime. @@ -21,19 +21,19 @@ var ( ) type config struct { - Host string `json:"host"` - Addr string `json:"addr"` - Store string `json:"store"` - Log string `json:"log"` + Host string `yaml:"host"` + Addr string `yaml:"addr"` + Store string `yaml:"store"` + Log string `yaml:"log"` S struct { - Prefix string `json:"prefix"` - } `json:"s"` + Prefix string `yaml:"prefix"` + } `yaml:"s"` X struct { - Prefix string `json:"prefix"` - VCS string `json:"vcs"` - ImportPath string `json:"import_path"` - RepoPath string `json:"repo_path"` - } `json:"x"` + Prefix string `yaml:"prefix"` + VCS string `yaml:"vcs"` + ImportPath string `yaml:"import_path"` + RepoPath string `yaml:"repo_path"` + } `yaml:"x"` } func (c *config) parse() { diff --git a/go.mod b/go.mod index 3534c0c..7870d02 100644 --- a/go.mod +++ b/go.mod @@ -4,5 +4,5 @@ go 1.15 require ( github.com/go-redis/redis/v8 v8.0.0 - gopkg.in/yaml.v2 v2.3.0 + gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c ) diff --git a/x.go b/x.go index dc3f9d5..09929a3 100644 --- a/x.go +++ b/x.go @@ -12,7 +12,7 @@ import ( "strings" ) -var xTmpl = template.Must(template.New("x").ParseFiles("public/x.html")) +var xTmpl = template.Must(template.ParseFiles("public/x.html")) type x struct { ImportRoot string