From 3c879663998f9727cb716913d7f259f6bf1a607f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Jul 2023 20:16:22 +0000 Subject: [PATCH] Bump github.com/iancoleman/strcase from 0.2.0 to 0.3.0 Bumps [github.com/iancoleman/strcase](https://github.com/iancoleman/strcase) from 0.2.0 to 0.3.0. - [Commits](https://github.com/iancoleman/strcase/compare/v0.2.0...v0.3.0) --- updated-dependencies: - dependency-name: github.com/iancoleman/strcase dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/iancoleman/strcase/acronyms.go | 11 +++++++---- vendor/github.com/iancoleman/strcase/camel.go | 11 +++++++++-- vendor/modules.txt | 2 +- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index 561aceb..d259e69 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/gocomply/xsd2go go 1.18 require ( - github.com/iancoleman/strcase v0.2.0 + github.com/iancoleman/strcase v0.3.0 github.com/markbates/pkger v0.17.1 github.com/stretchr/testify v1.8.4 github.com/urfave/cli v1.22.14 diff --git a/go.sum b/go.sum index bbe3a74..3f42f00 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/gobuffalo/here v0.6.0 h1:hYrd0a6gDmWxBM4TnrGw8mQg24iSVoIkHEk7FodQcBI= github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= diff --git a/vendor/github.com/iancoleman/strcase/acronyms.go b/vendor/github.com/iancoleman/strcase/acronyms.go index 9c3110d..7a2fb09 100644 --- a/vendor/github.com/iancoleman/strcase/acronyms.go +++ b/vendor/github.com/iancoleman/strcase/acronyms.go @@ -1,10 +1,13 @@ package strcase -var uppercaseAcronym = map[string]string{ - "ID": "id", -} +import ( + "sync" +) + +var uppercaseAcronym = sync.Map{} + //"ID": "id", // ConfigureAcronym allows you to add additional words which will be considered acronyms func ConfigureAcronym(key, val string) { - uppercaseAcronym[key] = val + uppercaseAcronym.Store(key, val) } diff --git a/vendor/github.com/iancoleman/strcase/camel.go b/vendor/github.com/iancoleman/strcase/camel.go index cd5a260..6b88689 100644 --- a/vendor/github.com/iancoleman/strcase/camel.go +++ b/vendor/github.com/iancoleman/strcase/camel.go @@ -35,13 +35,15 @@ func toCamelInitCase(s string, initCase bool) string { if s == "" { return s } - if a, ok := uppercaseAcronym[s]; ok { - s = a + a, hasAcronym := uppercaseAcronym.Load(s) + if hasAcronym { + s = a.(string) } n := strings.Builder{} n.Grow(len(s)) capNext := initCase + prevIsCap := false for i, v := range []byte(s) { vIsCap := v >= 'A' && v <= 'Z' vIsLow := v >= 'a' && v <= 'z' @@ -55,7 +57,12 @@ func toCamelInitCase(s string, initCase bool) string { v += 'a' v -= 'A' } + } else if prevIsCap && vIsCap && !hasAcronym { + v += 'a' + v -= 'A' } + prevIsCap = vIsCap + if vIsCap || vIsLow { n.WriteByte(v) capNext = false diff --git a/vendor/modules.txt b/vendor/modules.txt index 02f9127..ef6213d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -7,7 +7,7 @@ github.com/davecgh/go-spew/spew # github.com/gobuffalo/here v0.6.0 ## explicit; go 1.13 github.com/gobuffalo/here -# github.com/iancoleman/strcase v0.2.0 +# github.com/iancoleman/strcase v0.3.0 ## explicit; go 1.16 github.com/iancoleman/strcase # github.com/markbates/pkger v0.17.1