Skip to content

Commit

Permalink
chore(refactor): get rid of golang.org/x/exp (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
programmer04 authored Apr 22, 2024
1 parent 30d829f commit 20ac526
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ linters-settings:
gomodguard:
blocked:
modules:
- golang.org/x/exp:
recommendations:
- maps
- slices
- github.com/samber/lo
- github.com/pkg/errors:
recommendations:
- fmt
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ require (
github.com/kr/pretty v0.3.1
github.com/samber/lo v1.39.0
github.com/stretchr/testify v1.9.0
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b
k8s.io/api v0.29.4
k8s.io/apimachinery v0.29.4
k8s.io/client-go v0.29.4
Expand Down Expand Up @@ -52,6 +51,7 @@ require (
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go4.org/netipx v0.0.0-20230728184502-ec4c8b891b28 // indirect
golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/tools v0.17.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240314234333-6e1732d8331c // indirect
Expand Down
4 changes: 2 additions & 2 deletions modules/manager/controller_setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/url"
"reflect"

"golang.org/x/exp/maps"
"github.com/samber/lo"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
Expand Down Expand Up @@ -58,7 +58,7 @@ func SetupControllersShim(mgr manager.Manager, c *Config) ([]ControllerDef, erro
return []ControllerDef{}, err
}

return maps.Values(controllers), nil
return lo.Values(controllers), nil
}

// -----------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions pkg/utils/kubernetes/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package kubernetes

import (
"fmt"
"maps"
"slices"
"strings"

"golang.org/x/exp/maps"
"golang.org/x/exp/slices"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
)
Expand Down

0 comments on commit 20ac526

Please sign in to comment.