From 99e8cf9dc9874a41369486795b97846d2e49ce70 Mon Sep 17 00:00:00 2001 From: aimuz Date: Sun, 19 May 2024 00:17:42 +0800 Subject: [PATCH] fmt: replace sort with slices to reduce dependency tree This CL replaces the usage of sort with slices in fmt package, reducing the dependency tree. The fmt package previously depended on sort, which in turn depended on slices and other packages. This change simplifies the dependencies. --- src/fmt/errors.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fmt/errors.go b/src/fmt/errors.go index 1fbd39f8f17bf3..1ac83404bc7c55 100644 --- a/src/fmt/errors.go +++ b/src/fmt/errors.go @@ -6,7 +6,7 @@ package fmt import ( "errors" - "sort" + "slices" ) // Errorf formats according to a format specifier and returns the string as a @@ -34,7 +34,7 @@ func Errorf(format string, a ...any) error { err = w default: if p.reordered { - sort.Ints(p.wrappedErrs) + slices.Sort(p.wrappedErrs) } var errs []error for i, argNum := range p.wrappedErrs {