Skip to content

Commit

Permalink
Merge pull request #29 from go-playground/update-deps
Browse files Browse the repository at this point in the history
update deps
  • Loading branch information
deankarn authored Aug 8, 2021
2 parents 3f09364 + 1cbeb47 commit 19d19ad
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 8 deletions.
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
GOCMD=GO111MODULE=on go

linters-install:
@golangci-lint --version >/dev/null 2>&1 || { \
echo "installing linting tools..."; \
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.41.1; \
}

lint: linters-install
golangci-lint run

test:
$(GOCMD) test -cover -race ./...

bench:
$(GOCMD) test -bench=. -benchmem ./...

.PHONY: test lint linters-install
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/go-playground/universal-translator

go 1.13

require github.com/go-playground/locales v0.13.0
require github.com/go-playground/locales v0.14.0
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU=
github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
5 changes: 4 additions & 1 deletion import_export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,10 @@ func TestBadExport(t *testing.T) {
}
defer os.RemoveAll(dirname)

en.Add("day", "this is a day", false)
err = en.Add("day", "this is a day", false)
if err != nil {
t.Fatalf("Expected '%v' Got '%s'", nil, err)
}

expected := "open testdata/readonly/en.json: permission denied"
err = uni.Export(FormatJSON, dirname)
Expand Down
12 changes: 6 additions & 6 deletions translator.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,13 @@ func (t *translator) AddCardinal(key interface{}, text string, rule locales.Plur
}

} else {
tarr = make([]*transText, 7, 7)
tarr = make([]*transText, 7)
t.cardinalTanslations[key] = tarr
}

trans := &transText{
text: text,
indexes: make([]int, 2, 2),
indexes: make([]int, 2),
}

tarr[rule] = trans
Expand Down Expand Up @@ -211,13 +211,13 @@ func (t *translator) AddOrdinal(key interface{}, text string, rule locales.Plura
}

} else {
tarr = make([]*transText, 7, 7)
tarr = make([]*transText, 7)
t.ordinalTanslations[key] = tarr
}

trans := &transText{
text: text,
indexes: make([]int, 2, 2),
indexes: make([]int, 2),
}

tarr[rule] = trans
Expand Down Expand Up @@ -261,13 +261,13 @@ func (t *translator) AddRange(key interface{}, text string, rule locales.PluralR
}

} else {
tarr = make([]*transText, 7, 7)
tarr = make([]*transText, 7)
t.rangeTanslations[key] = tarr
}

trans := &transText{
text: text,
indexes: make([]int, 4, 4),
indexes: make([]int, 4),
}

tarr[rule] = trans
Expand Down

0 comments on commit 19d19ad

Please sign in to comment.