chore: code cleanup

More usage of slices package, less usage of package sort.

Signed-off-by: Dmitriy Matrenichev <dmitry.matrenichev@siderolabs.com>
This commit is contained in:
Dmitriy Matrenichev
2024-11-07 20:30:32 +03:00
parent 43fe3807a8
commit e26d0043e0
62 changed files with 189 additions and 204 deletions

View File

@@ -8,6 +8,7 @@ import (
"context"
"crypto/tls"
"fmt"
"slices"
"sync"
"time"
@@ -212,9 +213,8 @@ func (a *APID) AppendInfo(streaming bool, resp []byte) ([]byte, error) {
protowire.AppendVarint(nil, (metadataField<<3)|metadataType),
uint64(len(resp)+len(payload)),
)
resp = append(prefix, resp...)
return append(resp, payload...), err
return slices.Concat(prefix, resp, payload), err
}
// BuildError is called to convert error from upstream into response field.