Skip to content

Instantly share code, notes, and snippets.

@prasincs
Created May 14, 2017 04:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prasincs/e4ee8a3eff11b1bcf0ca37f3de9594a5 to your computer and use it in GitHub Desktop.
Save prasincs/e4ee8a3eff11b1bcf0ca37f3de9594a5 to your computer and use it in GitHub Desktop.
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