Skip to content

refactor: vendor ettle/strcase into internal/strcase - #65

Closed
kooksee wants to merge 2 commits into
v2from
refactor/internal-strcase
Closed

kooksee wants to merge 2 commits into
v2from
refactor/internal-strcase

Conversation

@kooksee

@kooksee kooksee commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Internalizes github.com/ettle/strcase (v0.2.0) as internal/strcase because the upstream project is no longer maintained. The upstream is MIT licensed; the license text and copyright notice are preserved in internal/strcase/LICENSE as the MIT license requires.

Changes

  • Copy the used subset of upstream sources into internal/strcase (caser, split, convert, initialisms, unicode helpers, package-level wrappers), with upstream tests (caser_test.go, strcase_test.go, unicode_test.go) kept as the behavioral spec. CLI, docs and the rest of the upstream repo were dropped.
  • Add an attribution note in internal/strcase/doc.go (upstream, version, license, do-not-extend policy).
  • Update the only importer, env/util.go, to the internal import path.
  • go mod tidy drops github.com/ettle/strcase from go.mod/go.sum.

No behavioral change: key normalization in env (T2HOST → T2_HOST etc.) is verified unchanged by the vendored upstream test suite plus the existing env/config tests.

Testing

  • Vendored upstream test suite passes (go test ./internal/strcase/)
  • go build ./..., go test ./env/ ./config/, go vet ./... clean
  • golangci-lint run repo-wide: 0 issues

Upstream github.com/ettle/strcase (v0.2.0) is no longer maintained.
Copy the sources the repo actually uses into internal/strcase, keeping
the package API frozen; upstream MIT license text and copyright notice
are preserved in internal/strcase/LICENSE as the license requires.

Only env/util.go imported the package; behavior is verified by the
vendored upstream test suite (caser/strcase/unicode tests) plus the
existing env/config tests.
Fast Fallback has been enabled by default since Go 1.12; the field is
deprecated and fails staticcheck SA1019 on CI.
@kooksee

kooksee commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #64 — the strcase vendoring commit (33f71e9) was cherry-picked onto fix/env-subst-numeric as a54c794, so this PR is superseded.

@kooksee kooksee closed this Oct 28, 2026
@kooksee
kooksee deleted the refactor/internal-strcase branch October 28, 2026 14:26
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.

1 participant