github.com/mhlo/force@v0.22.28-0.20150915022417-6d05ecfb0b47/sort.go (about) 1 package main 2 3 func (apps ForceConnectedApps) Len() int { 4 return len(apps) 5 } 6 7 func (apps ForceConnectedApps) Less(i, j int) bool { 8 return apps[i].Name < apps[j].Name 9 } 10 11 func (apps ForceConnectedApps) Swap(i, j int) { 12 apps[i], apps[j] = apps[j], apps[i] 13 } 14 15 func (f ForceSobjectFields) Len() int { 16 return len(f) 17 } 18 19 func (f ForceSobjectFields) Less(i, j int) bool { 20 return f[i].(map[string]interface{})["name"].(string) < f[j].(map[string]interface{})["name"].(string) 21 } 22 23 func (f ForceSobjectFields) Swap(i, j int) { 24 f[i], f[j] = f[j], f[i] 25 }