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

Enable ireturn linter and fix errors #480

Merged
merged 1 commit into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ linters:
- bodyclose
- goimports
- importas
- ireturn
linters-settings:
govet:
enable-all: true
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#475](https://github.com/XenitAB/spegel/pull/475) Move resolving ref to digest to manifest handler.
- [#477](https://github.com/XenitAB/spegel/pull/477) Refactor distribution ref to simplify registry routing.
- [#479](https://github.com/XenitAB/spegel/pull/479) Enable goimports linter and fix errors.
- [#480](https://github.com/XenitAB/spegel/pull/480) Enable ireturn linter and fix errors.

### Deprecated

Expand Down
2 changes: 1 addition & 1 deletion internal/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"k8s.io/client-go/tools/clientcmd"
)

func GetClientset(kubeconfigPath string) (kubernetes.Interface, error) {
func GetClientset(kubeconfigPath string) (*kubernetes.Clientset, error) {
if kubeconfigPath != "" {
cfg, err := clientcmd.BuildConfigFromFlags("", kubeconfigPath)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func registryCommand(ctx context.Context, args *RegistryCmd) (err error) {
return nil
}

func getBootstrapper(cfg BootstrapConfig) (routing.Bootstrapper, error) {
func getBootstrapper(cfg BootstrapConfig) (routing.Bootstrapper, error) { //nolint: ireturn // Return type can be different structs.
switch cfg.BootstrapKind {
case "http":
return routing.NewHTTPBootstrapper(cfg.HTTPBootstrapAddr, cfg.HTTPBootstrapPeer), nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/routing/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type KubernetesBootstrapper struct {
mx sync.RWMutex
}

func NewKubernetesBootstrapper(cs kubernetes.Interface, namespace, name string) Bootstrapper {
func NewKubernetesBootstrapper(cs kubernetes.Interface, namespace, name string) *KubernetesBootstrapper {
return &KubernetesBootstrapper{
leaderElectionNamespace: namespace,
leaderElectioName: name,
Expand Down