Skip to content

Commit

Permalink
duplacate msg header
Browse files Browse the repository at this point in the history
  • Loading branch information
youthlin committed Jan 19, 2025
1 parent 44f9135 commit 9c63088
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cmd/xtemplate/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.17
require (
github.com/cockroachdb/errors v1.8.6
github.com/smartystreets/goconvey v1.6.4
github.com/youthlin/t v0.0.5
github.com/youthlin/t v0.0.8
)

require (
Expand Down
4 changes: 2 additions & 2 deletions cmd/xtemplate/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Version the version
var Version string = "v0.0.5"
var Version string = "v0.0.9"

//go:embed lang
var embedLangs embed.FS
Expand Down Expand Up @@ -52,7 +52,7 @@ func buildParam() *internal.Param {
input = flag.String("i", "", t.T("input file pattern"))
left = flag.String("left", "{{", t.T("left delim"))
right = flag.String("right", "}}", t.T("right delim"))
keywords = flag.String("k", "", t.T("keywords e.g.: gettext;T:1;N1,2;X:1c,2;XN:1c,2,3"))
keywords = flag.String("k", "", t.T("keywords e.g.: gettext;T:1;N:1,2;X:1c,2;XN:1c,2,3"))
fun = flag.String("f", "", t.T("function names of template"))
output = flag.String("o", "", t.T("output file, - is stdout"))
debug = flag.Bool("d", false, t.T("debug mode"))
Expand Down
4 changes: 3 additions & 1 deletion translator/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ func (file *File) initHeader() {
kv := find[0]
k := strings.TrimSpace(kv[1])
v := strings.TrimSpace(kv[2])
headers[k] = v
if _, ok := headers[k]; !ok {
headers[k] = v
}
}
}
file.headers = headers
Expand Down

0 comments on commit 9c63088

Please sign in to comment.