Skip to content

Commit e64d29c

Browse files
committed
all: use gopkg.in/yaml.v3
1 parent 70134c4 commit e64d29c

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

config.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"os"
1111
"runtime"
1212

13-
"gopkg.in/yaml.v2"
13+
"gopkg.in/yaml.v3"
1414
)
1515

1616
// build info, assign by compile time or runtime.
@@ -21,19 +21,19 @@ var (
2121
)
2222

2323
type config struct {
24-
Host string `json:"host"`
25-
Addr string `json:"addr"`
26-
Store string `json:"store"`
27-
Log string `json:"log"`
24+
Host string `yaml:"host"`
25+
Addr string `yaml:"addr"`
26+
Store string `yaml:"store"`
27+
Log string `yaml:"log"`
2828
S struct {
29-
Prefix string `json:"prefix"`
30-
} `json:"s"`
29+
Prefix string `yaml:"prefix"`
30+
} `yaml:"s"`
3131
X struct {
32-
Prefix string `json:"prefix"`
33-
VCS string `json:"vcs"`
34-
ImportPath string `json:"import_path"`
35-
RepoPath string `json:"repo_path"`
36-
} `json:"x"`
32+
Prefix string `yaml:"prefix"`
33+
VCS string `yaml:"vcs"`
34+
ImportPath string `yaml:"import_path"`
35+
RepoPath string `yaml:"repo_path"`
36+
} `yaml:"x"`
3737
}
3838

3939
func (c *config) parse() {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ go 1.15
44

55
require (
66
github.com/go-redis/redis/v8 v8.0.0
7-
gopkg.in/yaml.v2 v2.3.0
7+
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
88
)

x.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"strings"
1313
)
1414

15-
var xTmpl = template.Must(template.New("x").ParseFiles("public/x.html"))
15+
var xTmpl = template.Must(template.ParseFiles("public/x.html"))
1616

1717
type x struct {
1818
ImportRoot string

0 commit comments

Comments
 (0)