Skip to content

Commit 54a8895

Browse files
authored
Merge pull request #149 from gojuno/bugfix/title
2 parents 2cee44a + 993a339 commit 54a8895

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ install:
3535
go install ./cmd/minimock
3636

3737
./bin/golangci-lint: ./bin
38-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./bin v1.55.2
38+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./bin v1.64.8
3939

4040
./bin/goreleaser: ./bin
4141
go install -modfile tools/go.mod github.com/goreleaser/goreleaser

cmd/minimock/minimock.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ import (
1212
"strings"
1313
"text/template"
1414
"time"
15+
"unicode"
1516

1617
"github.com/gojuno/minimock/v3"
1718
"github.com/gojuno/minimock/v3/internal/types"
1819
"github.com/hexdigest/gowrap/generator"
1920
"github.com/hexdigest/gowrap/pkg"
2021
"github.com/pkg/errors"
21-
"golang.org/x/text/cases"
2222
"golang.org/x/tools/go/packages"
2323
)
2424

@@ -33,7 +33,16 @@ var (
3333
)
3434

3535
var helpers = template.FuncMap{
36-
"title": cases.Title,
36+
"title": func(s string) string {
37+
runes := []rune(s)
38+
for i, r := range runes {
39+
if unicode.IsLetter(r) {
40+
runes[i] = unicode.ToUpper(r)
41+
break
42+
}
43+
}
44+
return string(runes)
45+
},
3746
"in": func(s string, in ...string) bool {
3847
s = strings.Trim(s, " ")
3948
for _, i := range in {

0 commit comments

Comments
 (0)