gempir

Untitled

Jan 2nd, 2019
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.25 KB | None | 0 0
  1.     sort.Slice(logFiles, func(i, j int) bool {
  2.         yearA, _ := strconv.Atoi(logFiles[i].year)
  3.         yearB, _ := strconv.Atoi(logFiles[j].year)
  4.         monthA, _ := strconv.Atoi(logFiles[j].month)
  5.         monthB, _ := strconv.Atoi(logFiles[j].month)
  6.         return numA > numB
  7.     })
Advertisement
Add Comment
Please, Sign In to add comment