Skip to content

add go.mod - #72

Merged
thaJeztah merged 1 commit into
docker:mainfrom
thaJeztah:go_mod
Aug 28, 2026
Merged

add go.mod#72
thaJeztah merged 1 commit into
docker:mainfrom
thaJeztah:go_mod

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

add go.mod

We delayed adding a go.mod and to stick with vendor.mod in case
we wanted to transfer this repository to the moby org.

However, renaming / moving a module will always be impactful, and
there's no "clean" way to do a move; if the old location didn't
have a go.mod, no naming is enforced, so a reference could be
used either as "old module name" or "new module name".

If a go.mod was present before, and after the rename, then go
tools can still handle it incorrectly; it resolves the reference
(git sha or tag) BEFORE checking if the module name matches
what's defined in go.mod (if present).

The only alternative is to create a "blessed" hard-fork, and
archive the old repository (marking it as deprecated in its
go.mod) to steer users to the new module name.

Either approach won't see downsides to having a go.mod present,
and in fact for the "blessed hard fork", is even preferable, so
let's add one.

We delayed adding a go.mod and to stick with vendor.mod in case
we wanted to transfer this repository to the moby org.

However, renaming / moving a module will always be impactful, and
there's no "clean" way to do a move; if the old location didn't
have a `go.mod`, no naming is enforced, so a reference could be
used either as "old module name" or "new module name".

If a `go.mod` was present before, and after the rename, then go
tools can still handle it incorrectly; it resolves the reference
(git sha or tag) _BEFORE_ checking if the module name matches
what's defined in `go.mod` (if present).

The only alternative is to create a "blessed" hard-fork, and
archive the old repository (marking it as deprecated in its
`go.mod`) to steer users to the new module name.

Either approach won't see downsides to having a `go.mod` present,
and in fact for the "blessed hard fork", is even preferable, so
let's add one.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah
thaJeztah marked this pull request as ready for review August 28, 2026 11:24
@thaJeztah
thaJeztah requested a lite review from Copilot August 28, 2026 11:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class Go module metadata to github.com/docker/go-events (moving away from the prior CI-time symlink approach) and updates CI workflows accordingly.

Changes:

  • Introduces go.mod and go.sum for module-aware builds.
  • Removes the “Create go.mod” symlink step from CI and CodeQL workflows now that module files exist.

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated no comments.

File Description
go.mod Adds module definition, Go version, and initial requirements.
go.sum Adds dependency checksums for module verification.
.github/workflows/ci.yml Removes go.mod/go.sum symlink creation step from CI jobs.
.github/workflows/codeql.yml Removes go.mod/go.sum symlink creation step from CodeQL workflow.
Suppressed comments (1)

.github/workflows/ci.yml:36

  • The workflow’s lint job pins Go to oldstable. Now that go.mod exists (and the test job uses it via go-version-file), lint may run on a different Go version than the module’s declared minimum; if oldstable resolves to a version lower than the go directive, this job will fail with “go.mod requires go >= …”. Consider using go-version-file: go.mod here to keep CI consistent with the module definition.
      - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0
        with:
          go-version: "oldstable"
          cache: false

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@thaJeztah

Copy link
Copy Markdown
Member Author

Will do some small follow-ups; now that we have a go.mod, we can use go fix to modernize some bits, and I spotted some other issues to address.

@thaJeztah
thaJeztah merged commit a885f3a into docker:main Aug 28, 2026
13 checks passed
@thaJeztah
thaJeztah deleted the go_mod branch August 28, 2026 11:29
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