Created
February 25, 2015 20:01
-
-
Save ateoto/92ababb26813223eab4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Tag struct { | |
Major int | |
Minor int | |
Name string | |
} | |
type Tags []Tag | |
func (slice Tags) Len() int { | |
return len(slice) | |
} | |
func (slice Tags) Less(i, j int) bool { | |
return slice[i].Major < slice[j].Major && slice[i].Minor < slice[j].Minor | |
} | |
func (slice Tags) Swap(i, j int) { | |
slice[i], slice[j] = slice[j], slice[i] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment