Skip to content

Modernize for current Go toolchains#107

Merged
soheilhy merged 1 commit into
masterfrom
modernize-go
Jun 8, 2026
Merged

Modernize for current Go toolchains#107
soheilhy merged 1 commit into
masterfrom
modernize-go

Conversation

@soheilhy

@soheilhy soheilhy commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

The library already compiled and passed tests, but its tooling and dependencies had gone stale. This brings everything up to current standards without changing public behavior.

Library (go 1.23.0)

  • cmux_test.go — fixes 8 go vet failures: three writer goroutines called t.Fatal off the test goroutine; they now send to the existing errCh (made buffered so the sends can't leak). Also ioutil.ReadAllio.ReadAll.
  • matchers.goio/ioutilio (io.Discard); gofmt -s doc-comment fix.
  • go.modgo 1.11go 1.23.0; golang.org/x/net bumped from the 2020 snapshot to v0.42.0 (newest release that still permits a 1.23 directive — v0.45+ require 1.24).

Example submodule (separate, demo-only)

  • golang.org/x/net/context → stdlib context.
  • grpc v1.27.0v1.80, modern protobuf (deprecated github.com/golang/protobuf dropped). helloworld now comes from the separate google.golang.org/grpc/examples module, which requires go 1.25 — isolated to this demo module; the importable library stays at 1.23.

CI

  • Removes the ancient .travis.yml (Go 1.6–1.8).
  • Adds .github/workflows/ci.yml: gofmt/vet/build/test -race for the library (Go 1.23 + 1.24 matrix) and the example.

Intentionally unchanged

  • Temporary() methodsnet.Error still requires them; removing breaks compilation.
  • TLS version defaults (tls.VersionSSL30/TLS10/TLS11) — changing the default whitelist is a public-API behavior change, out of scope.

Verification

Both modules pass gofmt -s, go vet, go build, and go test -race.

🤖 Generated with Claude Code

The library already compiled and passed tests, but tooling and
dependencies were stale. This brings everything up to current standards
without changing public behavior.

Library (go 1.23.0):
- cmux_test.go: fix 8 `go vet` failures by sending writer-goroutine
  errors to the existing errCh (now buffered) instead of t.Fatal;
  ioutil.ReadAll -> io.ReadAll
- matchers.go: io/ioutil -> io (io.Discard); gofmt -s doc comment
- go.mod: go 1.11 -> 1.23.0; golang.org/x/net -> v0.42.0 (newest
  release that still permits a 1.23 directive)

Example submodule:
- golang.org/x/net/context -> stdlib context
- grpc v1.27.0 -> v1.80, modern protobuf; helloworld now comes from
  the separate google.golang.org/grpc/examples module (requires go 1.25,
  isolated to this demo-only module)

CI:
- remove ancient .travis.yml (Go 1.6-1.8)
- add .github/workflows/ci.yml: gofmt/vet/build/test -race for the
  library (Go 1.23 + 1.24 matrix) and the example

Temporary() methods and TLS version defaults are intentionally
unchanged: net.Error still requires Temporary(), and the TLS defaults
are public-API behavior.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@soheilhy soheilhy merged commit 7b740c1 into master Jun 8, 2026
3 checks passed
@soheilhy soheilhy deleted the modernize-go branch June 8, 2026 03:39
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