1
0
mirror of https://github.com/directorz/mailfull-go.git synced 2025-12-21 19:47:06 +00:00

Remove types for sort.Interface

This commit is contained in:
teru
2017-07-25 12:29:23 +09:00
parent 58b50cb3f6
commit c7e56f26af
9 changed files with 10 additions and 38 deletions

View File

@@ -17,13 +17,6 @@ type Domain struct {
CatchAllUser *CatchAllUser
}
// DomainSlice attaches the methods of sort.Interface to []*Domain.
type DomainSlice []*Domain
func (p DomainSlice) Len() int { return len(p) }
func (p DomainSlice) Less(i, j int) bool { return p[i].Name() < p[j].Name() }
func (p DomainSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
// NewDomain creates a new Domain instance.
func NewDomain(name string) (*Domain, error) {
d := &Domain{}