MCPcopy Create free account
hub / github.com/docker/compose / Less

Method Less

pkg/api/api.go:572–585  ·  view source on GitHub ↗

Less implements sort.Interface

(i, j int)

Source from the content-addressed store, hash-verified

570
571// Less implements sort.Interface
572func (p PortPublishers) Less(i, j int) bool {
573 left := p[i]
574 right := p[j]
575 if left.URL != right.URL {
576 return left.URL < right.URL
577 }
578 if left.TargetPort != right.TargetPort {
579 return left.TargetPort < right.TargetPort
580 }
581 if left.PublishedPort != right.PublishedPort {
582 return left.PublishedPort < right.PublishedPort
583 }
584 return left.Protocol < right.Protocol
585}
586
587// Swap implements sort.Interface
588func (p PortPublishers) Swap(i, j int) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected