Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert to strings.Title again for pascalCase #582

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

r-hang
Copy link
Contributor

@r-hang r-hang commented Jun 9, 2023

PR #578 replaced strings.Title with golang.org/x/text/cases due to staticcheck SA1019. There is at least one behavioral difference between these two Title casing approaches uncovered during pre-release testing.

A test case to flag this change and an exemption for staticcheck in the relevant file are also added.

Example:

chunk := "10x"
fmt.Println(strings.Title(strings.ToLower(chunk))) # 10x
fmt.Println(cases.Title(language.English).String(strings.ToLower(chunk))) # 10X

@r-hang r-hang requested a review from sywhang June 9, 2023 00:46
@r-hang r-hang force-pushed the rhang/reuse-strings-title branch 3 times, most recently from cd2d438 to 46b1492 Compare June 9, 2023 00:49
gen/string_test.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Jun 9, 2023

Codecov Report

Merging #582 (2155616) into dev (0977c0d) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 2155616 differs from pull request most recent head 495fa70. Consider uploading reports for the commit 495fa70 to get more accurate results

@@           Coverage Diff           @@
##              dev     #582   +/-   ##
=======================================
  Coverage   68.01%   68.01%           
=======================================
  Files         142      142           
  Lines       23878    23878           
=======================================
  Hits        16241    16241           
  Misses       4577     4577           
  Partials     3060     3060           
Impacted Files Coverage Δ
gen/string.go 78.57% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

PR #578 replaced strings.Title with golang.org/x/text/cases due to
staticcheck SA1019. There is at least one behavioral difference
between these two Title casing approaches uncovered during pre-release
testing.

A test case to flag this change and an exemption for staticcheck in
the relevant file are also added.

Example:
```
chunk := "10x"
fmt.Println(strings.Title(strings.ToLower(chunk))) # 10x
fmt.Println(cases.Title(language.English).String(strings.ToLower(chunk))) # 10X
```
@r-hang r-hang force-pushed the rhang/reuse-strings-title branch from 2155616 to 495fa70 Compare June 9, 2023 01:12
@r-hang r-hang merged commit c8201b9 into dev Jun 9, 2023
@r-hang r-hang deleted the rhang/reuse-strings-title branch June 9, 2023 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants