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

gookit / goutil / 38506084542
87%

Build:
DEFAULT BRANCH: master
Ran 14 Oct 2026 03:24AM UTC
Jobs 0
Files 0
Run time –
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

pending completion
38506084542

push

github

web-flow
fix(strutil): bound SubstrCount ranges using rune lengths (#271)

SubstrCount uses rune indexes but derives the default end from the byte length. For example, `SubstrCount("你好你好", "", 1)` returns 12 instead of 4, and an offset beyond the string panics.

Use the rune length for range bounds, return an error for an invalid offset, and clamp oversized lengths before converting uint64 to int. Regression cases cover Unicode, empty ranges, and maximum uint64 arguments.

Validation: `go test ./...`, `go vet ./...`, `go build ./...`, and `go test -race ./strutil -run TestSubstrCountRuneRanges -count=1` pass on macOS/arm64 with Go 1.26.5. The new Unicode and invalid-offset tests fail before the fix. Other OS/Go versions are left to hosted CI.
Source Files on build 38506084542
Detailed source file information is not available for this build.
  • Back to Repo
  • 2a0cea30 on github
  • Prev Build on master (#38500083956)
  • Next Build on master (#38520003066)
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