mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 14:20:55 +03:00
replace hand-written slice utilities with methods from slices package
SFTPGo depends on Go 1.22 so we can use slices package Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -809,15 +809,6 @@ func GetRedactedURL(rawurl string) string {
|
||||
return u.Redacted()
|
||||
}
|
||||
|
||||
// PrependFileInfo prepends a file info to a slice in an efficient way.
|
||||
// We, optimistically, assume that the slice has enough capacity
|
||||
func PrependFileInfo(files []os.FileInfo, info os.FileInfo) []os.FileInfo {
|
||||
files = append(files, nil)
|
||||
copy(files[1:], files)
|
||||
files[0] = info
|
||||
return files
|
||||
}
|
||||
|
||||
// GetTLSVersion returns the TLS version for integer:
|
||||
// - 12 means TLS 1.2
|
||||
// - 13 means TLS 1.3
|
||||
|
||||
Reference in New Issue
Block a user