Conversation
BREAKING CHANGES: - Removed all generated Asset*/AssetDir/AssetNames/AssetInfo functions (bindata.go deleted) - New Country.AltSpellings field, indexed by FindCountryByName for short-form lookups - NewFromPath now takes a directory path read via os.DirFS; layout still expects countries/ + subdivisions/ subdirs - Embedded YAML data is now loaded via //go:embed (Go 1.16+)
The name-match branch had `==` instead of `!=`, so callers passing
`Country{Name.Common: "Sweden"}` got back every country *except*
Sweden. Fix swaps the comparison to `!strings.EqualFold(...)` matching
the convention of every other filter branch.
Both populateCountries and populateSubdivisions used to swallow yaml.Unmarshal errors with `continue`, producing a Query with arbitrary gaps and no signal to the operator. Now they panic with the offending filename — fail-loud is correct for embedded data the auto-sync workflow regenerates.
- 3× SA6005: replace strings.ToLower(x) != strings.ToLower(y) with !strings.EqualFold - 3× S1002: drop redundant ==true / ==false comparisons - ST1000: add package doc comment - ST1020: complete FindCountryByNativeName godoc - Add .golangci.yml (staticcheck minus QF noise + errcheck/govet/ineffassign/unused/misspell) - Add Lint job to CI workflow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rebuilds gountries' data pipeline from scratch and lands it as a draft v1.0.0. The previous setup (custom `gountries-creator` + manual `go-bindata` regen + `pariz/countries` source repo) had drifted out of date and the regen step was undocumented. Replaced with a fully automated, weekly-refreshed pipeline backed by two actively maintained upstream projects.
What changed
Data sources (now vendored as git submodules under `third_party/`):
Embedding: `go-bindata` → `//go:embed` (stdlib, Go 1.16+). `bindata.go` deleted.
Pipeline:
API surface (breaking):
Data shape changes (visible to consumers):
Tests
Migration for downstream users
Pin the old release if needed:
```
go get github.com/pariz/gountries@v0.1.6
```
Otherwise, see CHANGELOG.md for the full migration list.
License
Go code stays MIT. Embedded `data/yaml/` becomes a Derivative Database under ODbL by virtue of incorporating mledoze fields. Querying the data through this Go API does not propagate ODbL to downstream apps (it produces a Produced Work, not a Derivative Database).
Plan