From 7ecc8ec1b615fb42e13625fb0aed76b3925c7312 Mon Sep 17 00:00:00 2001 From: cui fliter Date: Fri, 4 Oct 2024 01:10:29 +0800 Subject: [PATCH] refactor: Directly swap variable values (#5305) Signed-off-by: cuishuang --- internal/registry/inmemory/inmemory_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/registry/inmemory/inmemory_test.go b/internal/registry/inmemory/inmemory_test.go index 16c3f8093..e42581523 100644 --- a/internal/registry/inmemory/inmemory_test.go +++ b/internal/registry/inmemory/inmemory_test.go @@ -215,7 +215,7 @@ func (l serviceList) Less(i, j int) bool { return l[i].Kind < l[j].Kind } -func (l serviceList) Swap(i, j int) { t := l[i]; l[i] = l[j]; l[j] = t } +func (l serviceList) Swap(i, j int) { l[i], l[j] = l[j], l[i] } func assertEqual(t *testing.T, want, got []*pb.Service) { t.Helper()