Skip to content

Commit

Permalink
all: use gopkg.in/yaml.v3
Browse files Browse the repository at this point in the history
  • Loading branch information
changkun committed Sep 16, 2020
1 parent 70134c4 commit e64d29c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"os"
"runtime"

"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

// build info, assign by compile time or runtime.
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
2 changes: 1 addition & 1 deletion x.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e64d29c

Please sign in to comment.