chore: change interface{} to any (#2818)
* chore: change interface{} to any
* chore: update goctl version to 1.5.0
* chore: update goctl deps
This commit is contained in:
@@ -24,7 +24,7 @@ func NewEventHandler(update func([]string)) *EventHandler {
|
||||
}
|
||||
|
||||
// OnAdd handles the endpoints add events.
|
||||
func (h *EventHandler) OnAdd(obj interface{}) {
|
||||
func (h *EventHandler) OnAdd(obj any) {
|
||||
endpoints, ok := obj.(*v1.Endpoints)
|
||||
if !ok {
|
||||
logx.Errorf("%v is not an object with type *v1.Endpoints", obj)
|
||||
@@ -50,7 +50,7 @@ func (h *EventHandler) OnAdd(obj interface{}) {
|
||||
}
|
||||
|
||||
// OnDelete handles the endpoints delete events.
|
||||
func (h *EventHandler) OnDelete(obj interface{}) {
|
||||
func (h *EventHandler) OnDelete(obj any) {
|
||||
endpoints, ok := obj.(*v1.Endpoints)
|
||||
if !ok {
|
||||
logx.Errorf("%v is not an object with type *v1.Endpoints", obj)
|
||||
@@ -76,7 +76,7 @@ func (h *EventHandler) OnDelete(obj interface{}) {
|
||||
}
|
||||
|
||||
// OnUpdate handles the endpoints update events.
|
||||
func (h *EventHandler) OnUpdate(oldObj, newObj interface{}) {
|
||||
func (h *EventHandler) OnUpdate(oldObj, newObj any) {
|
||||
oldEndpoints, ok := oldObj.(*v1.Endpoints)
|
||||
if !ok {
|
||||
logx.Errorf("%v is not an object with type *v1.Endpoints", oldObj)
|
||||
|
||||
@@ -34,7 +34,7 @@ func TestSubset(t *testing.T) {
|
||||
vals = append(vals, strconv.Itoa(i))
|
||||
}
|
||||
|
||||
m := make(map[interface{}]int)
|
||||
m := make(map[any]int)
|
||||
for i := 0; i < 1000; i++ {
|
||||
set := subset(append([]string(nil), vals...), test.sub)
|
||||
if test.sub < test.set {
|
||||
|
||||
Reference in New Issue
Block a user