Skip to content

Modernise Go idioms, clean up deps, add Go 1.24 to CI - #14

Merged
corbym merged 2 commits into
masterfrom
copilot/add-builds-against-newer-go-versions
Apr 2, 2026
Merged

corbym merged 2 commits into
masterfrom
copilot/add-builds-against-newer-go-versions

Conversation

Copilot AI commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Brings the codebase up to current Go standards: replaces pre-1.18 idioms with their modern equivalents, removes unnecessary dependencies, and extends CI coverage to Go 1.24.

CI / build tooling

  • Add 1.24.x to the build matrix
  • go mod tidy — removes three unused/deprecated indirect deps (golang.org/x/sys, golang.org/x/tools, golang.org/x/tools/cmd/cover)

README

  • GoDoc badge: godoc.org → pkg.go.dev

Go idiom updates

  • interface{} → any (testingt.go, matcher.go, stubtestingt_test.go, then/eventually.go, matcher_test.go)
  • map[interface{}]bool → properly-typed map[V]bool / map[T]bool in is/contains.go — the generic type parameters were already comparable, so this was always valid
  • C-style for i := 0; i < len(x); i++ → for _, v := range x throughout (is/contains.go, is/allof.go, is/anyof.go, is/describe.go, has/haseveryelement.go)
  • time.Duration(N)*time.Second → N*time.Second
  • fmt.Sprintf("%s", x) → direct string assignment (is/allof.go)
  • Remove redundant actual.(io.Reader) assertion — actual is already typed as io.Reader (by/eventually.go)

Bug fix

WithinFiveSeconds was passing 10*time.Second as its timeout — corrected to 5*time.Second.

Dead code removal

Unused actualKeys slice in mapActualMatchesExpected (is/contains.go) — built but never read.

Copilot AI and others added 2 commits April 2, 2026 11:34
@corbym
corbym marked this pull request as ready for review April 2, 2026 11:45
@corbym
corbym merged commit 3601168 into master Apr 2, 2026
11 checks passed
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 3.888% (+0.05%) from 3.834%
when pulling 212b3ab on copilot/add-builds-against-newer-go-versions
into 89a4236 on master.

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.

3 participants