logger: improvements
All checks were successful
lint / lint (pull_request) Successful in 1m51s
test / test (pull_request) Successful in 12m57s

* logger: add WithDedupKeys option

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-12-13 00:24:11 +03:00
parent 8f185abd9d
commit 9406a33d60
5 changed files with 155 additions and 76 deletions

View File

@@ -1,7 +1,6 @@
package sort
import (
"fmt"
"sort"
)
@@ -9,7 +8,7 @@ import (
type byKey []interface{}
func (k byKey) Len() int { return len(k) / 2 }
func (k byKey) Less(i, j int) bool { return fmt.Sprintf("%s", k[i*2]) < fmt.Sprintf("%s", k[j*2]) }
func (k byKey) Less(i, j int) bool { return k[i*2].(string) < k[j*2].(string) }
func (k byKey) Swap(i, j int) {
k[i*2], k[j*2] = k[j*2], k[i*2]
k[i*2+1], k[j*2+1] = k[j*2+1], k[i*2+1]