Skip to content

Commit 9ba897a

Browse files
committed
Refactor Eventf method signatures to use 'any' type for variadic arguments
1 parent f9c4eba commit 9ba897a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/multicluster/recorder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (c *Client) GetEventRecorder(name string) events.EventRecorder {
5050

5151
// Eventf routes the event to the cluster that owns the "regarding" object.
5252
// Falls back to the home cluster recorder if routing fails.
53-
func (r *MultiClusterRecorder) Eventf(regarding runtime.Object, related runtime.Object, eventtype, reason, action, note string, args ...interface{}) {
53+
func (r *MultiClusterRecorder) Eventf(regarding, related runtime.Object, eventtype, reason, action, note string, args ...any) {
5454
recorder := r.recorderFor(regarding)
5555
recorder.Eventf(regarding, related, eventtype, reason, action, note, args...)
5656
}

pkg/multicluster/recorder_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type eventfCall struct {
2929
note string
3030
}
3131

32-
func (f *fakeEventRecorder) Eventf(regarding runtime.Object, _ runtime.Object, eventtype, reason, action, note string, args ...interface{}) {
32+
func (f *fakeEventRecorder) Eventf(regarding, _ runtime.Object, eventtype, reason, action, note string, args ...any) {
3333
f.mu.Lock()
3434
defer f.mu.Unlock()
3535
f.calls = append(f.calls, eventfCall{
@@ -239,7 +239,7 @@ func TestMultiClusterRecorder_ConcurrentEventf(t *testing.T) {
239239
const goroutines = 20
240240
var wg sync.WaitGroup
241241
wg.Add(goroutines)
242-
for i := 0; i < goroutines; i++ {
242+
for i := range goroutines {
243243
go func(n int) {
244244
defer wg.Done()
245245
history := &v1alpha1.History{

0 commit comments

Comments
 (0)