sftp/packet-manager_legacy.go

14 lines
404 B
Go
Raw Normal View History

// +build !go1.8
package sftp
import "sort"
// for sorting/ordering incoming/outgoing
type responsePackets []responsePacket
func (r responsePackets) Len() int { return len(r) }
func (r responsePackets) Swap(i, j int) { r[i], r[j] = r[j], r[i] }
func (r responsePackets) Less(i, j int) bool { return r[i].id() < r[j].id() }
func (r responsePackets) Sort() { sort.Sort(r) }