Created
May 14, 2017 04:11
-
-
Save prasincs/e4ee8a3eff11b1bcf0ca37f3de9594a5 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
import "github.com/nsd20463/numeralsort" | |
func (c SortImageIds) Len() int { return len(c) } | |
func (c SortImageIds) Swap(i, j int) { c[i], c[j] = c[j], c[i] } | |
func (c SortImageIds) Less(i, j int) bool { | |
//fmt.Println(*c[i].ImageTag, *c[j].ImageTag) | |
if c[i].ImageTag == nil { | |
return true | |
} | |
if c[j].ImageTag == nil { | |
return false | |
} | |
return numeralsort.Less(*c[i].ImageTag, *c[j].ImageTag) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment