Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename util.go → utils.go #7925

Open
jandubois opened this issue Dec 11, 2024 · 0 comments
Open

Rename util.go → utils.go #7925

jandubois opened this issue Dec 11, 2024 · 0 comments
Labels
kind/quality quality improvements, refactoring, Automation via CI, E2E, Integration, CLI or REST API platform/windows
Milestone

Comments

@jandubois
Copy link
Member

src/go/guestagent/pkg/utils/util.go has package utils and is in directory utils and should therefore be called utils.go.

Also the package is in one place imported as rdUtils:

$ ag pkg/utils
containerd/events_linux.go
33:	"github.com/containernetworking/plugins/pkg/utils"
36:	rdUtils "github.com/rancher-sandbox/rancher-desktop/src/go/guestagent/pkg/utils"

docker/events.go
33:	"github.com/rancher-sandbox/rancher-desktop/src/go/guestagent/pkg/utils"

iptables/iptables.go
28:	"github.com/rancher-sandbox/rancher-desktop/src/go/guestagent/pkg/utils"

iptables/iptables_test.go
26:	"github.com/rancher-sandbox/rancher-desktop/src/go/guestagent/pkg/utils"

procnet/scanner_linux.go
38:	"github.com/rancher-sandbox/rancher-desktop/src/go/guestagent/pkg/utils"

For consistency it should be imported in all files using the same package name, and the package name should be all lowercase, with no underscore, so e.g. rdutils.

@jandubois jandubois added platform/windows kind/quality quality improvements, refactoring, Automation via CI, E2E, Integration, CLI or REST API labels Dec 11, 2024
@gunamata gunamata added this to the 1.18 milestone Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/quality quality improvements, refactoring, Automation via CI, E2E, Integration, CLI or REST API platform/windows
Projects
None yet
Development

No branches or pull requests

2 participants