• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

go-playground / validator / 40776322458
73%
v8: 100%

Build:
Build:
LAST BUILD BRANCH: fix/duration-translations
DEFAULT BRANCH: v8
Ran 28 Oct 2026 09:59PM UTC
Jobs 1
Files 36
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

28 Oct 2026 09:58PM UTC coverage: 72.577% (+0.008%) from 72.569%
40776322458

push

github

web-flow
fix: reject duplicate variants in strict BCP47 tags (#1678)

## Fixes Or Enhances

Fixes #1677. The strict BCP47 validator checks that each variant is
registered but did not check whether the same variant already occurred
in the tag. RFC5646 section2.2.5 item5 explicitly prohibits repeated
variants and gives `de-DE-1901-1901` as invalid:
https://www.rfc-editor.org/rfc/rfc5646.html#section-2.2.5.

Track variants in a local set inside the existing variant loop. The
input has already been lowercased, so mixed-case repeats are rejected
too. Six production lines; no changes to the non-strict
validator,variant-prefix recommendations,private-use subtags or registry
data.

- [x] Tests exist or have been written that cover this particular
change.

Five duplicate-variant subtests fail on unchanged source and five
controls pass. All ten pass after the fix. Controls retain distinct
variants,mixed-case distinct variants,and repeated content in
private-use subtags. Added a focused benchmark and one documentation
sentence. There is no repository changelog file/convention requiring a
separate entry.

### Local validation

Linuxamd64,Go1.27.3 and Go1.26.10,baseline a5843c6 -> head5c0c4d5:
- `go test -run 'TestBCP47.*' -count=1 -v`:passes existing
strict/non-strict tests and all ten new subtests.
- `go test -race -covermode=atomic -coverprofile=... ./...`:passes all
packages on Go1.27.3; rootpackage97.5%statementcoverage.
- `go test ./...`:passes all packages on Go1.26.10. Untouched baseline
Go1.27.3 full suite also passes.
- Focused race repeat `go test -race -run
TestBCP47StrictDuplicateVariants -count=20`:passes.
- `go vet ./...`:passes on Go1.27.3.
- Project-pinned golangci-lintv2.13.1 on Go1.26.10:0issues. That
linter's prebuilt binary cannot decode Go1.27exportdata; rerun on the
CI-configured Go1.26toolchain resolves this tooling limitation.
- `gofmt` and `git diff --check`:pass.
- NativeWindows/macOS and upstreamCI results are not claimed.

### Benchmark

Eight ... (continued)

6 of 6 new or added lines in 1 file covered. (100.0%)

15019 of 20694 relevant lines covered (72.58%)

90.31 hits per line

Jobs
ID Job ID Ran Files Coverage
1 40776322458.1 28 Oct 2026 09:59PM UTC 36
72.58
GitHub Action Run
Source Files on build 40776322458
  • Tree
  • List 36
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 563e7380 on github
  • Prev Build on master (#40600899027)
  • Next Build on master (#40968509375)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc