Skip to content

Comments

pkg/reexec: deprecate and migrate to github.com/moby/sys/reexec#49129

Merged
akerouanton merged 1 commit intomoby:masterfrom
thaJeztah:migrate_reexec
Dec 19, 2024
Merged

pkg/reexec: deprecate and migrate to github.com/moby/sys/reexec#49129
akerouanton merged 1 commit intomoby:masterfrom
thaJeztah:migrate_reexec

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Dec 18, 2024

- Description for the changelog

pkg/reexec: deprecate and migrate to github.com/moby/sys/reexec. This package is deprecated and moved to a separate module. Use github.com/moby/sys/reexec instead.

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added status/2-code-review impact/deprecation kind/refactor PR's that refactor, or clean-up code area/go-sdk impact/go-sdk Noteworthy (compatibility changes) in the Go SDK labels Dec 18, 2024
@thaJeztah thaJeztah added this to the 28.0.0 milestone Dec 18, 2024
@thaJeztah thaJeztah self-assigned this Dec 18, 2024
@thaJeztah thaJeztah marked this pull request as ready for review December 18, 2024 20:11
// Register adds an initialization func under the specified name. It panics
// if the given name is already registered.
//
// Deprecated: uUse [reexec.Register] instead.
Copy link
Contributor

@austinvazquez austinvazquez Dec 19, 2024

Choose a reason for hiding this comment

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

typo: uUse -> use

Also looks like the other functions got it as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

DOH! I'll fix that

Copy link
Member Author

Choose a reason for hiding this comment

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

OK; updated; should look good now;

Screenshot 2024-12-19 at 10 31 54 Screenshot 2024-12-19 at 10 32 13

package reexec

import (
"os/exec"
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this dependency required for the godoc link?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's needed for the aliases currently, as exec.Cmd is part of the signature;

func Command(args ...string) *exec.Cmd {

The alternative is to use variables to alias, but I slightly moved away from that approach, as pkg.go.dev docs will then show an empty "functions" block, and only "variables" in the package. Also because these are exported, it would mean technically anything could overwrite / replace the function, which definitely would be unwanted.

I once opened a proposal in Go's issue tracker for being able to alias a package as a whole, but they were not receptive to that;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/go-sdk impact/deprecation impact/go-sdk Noteworthy (compatibility changes) in the Go SDK kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

Development

Successfully merging this pull request may close these issues.

4 participants