Skip to content

Commit

Permalink
Merge pull request #3 from abdullah-alaadine/deprecated-strings-dot-t…
Browse files Browse the repository at this point in the history
…itle

Deprecated strings dot title upgrades
  • Loading branch information
AAVision authored Jul 7, 2023
2 parents 43bbc06 + 8472581 commit 6c6544b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ require (
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.1.0 // indirect
golang.org/x/text v0.11.0 // indirect
)
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,7 @@ golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.1.0 h1:g6Z6vPFA9dYBAF7DWcH6sCcOntplXsDKcliusYijMlw=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
7 changes: 5 additions & 2 deletions munge.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"strings"

"github.com/gookit/color"
"golang.org/x/text/cases"
"golang.org/x/text/language"
)

var tmpWordList []string
Expand Down Expand Up @@ -103,13 +105,14 @@ func removeDuplication(arr []string) []string {
}

func munge(wrd string, level int) {
caser := cases.Title(language.English)
if level > 0 {
tmpWordList = append(tmpWordList, wrd)
tmpWordList = append(tmpWordList, strings.ToUpper(wrd))
tmpWordList = append(tmpWordList, strings.Title(wrd))
tmpWordList = append(tmpWordList, caser.String(wrd))
}
if level > 2 {
temp := strings.Title(wrd)
temp := caser.String(wrd)
tmpWordList = append(tmpWordList, strings.ToLower(temp))
}
if level > 4 {
Expand Down

0 comments on commit 6c6544b

Please sign in to comment.