Skip to content

Instantly share code, notes, and snippets.

@aybabtme
Created February 4, 2015 06:05
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 aybabtme/6bf2edacedabc7445c38 to your computer and use it in GitHub Desktop.
Save aybabtme/6bf2edacedabc7445c38 to your computer and use it in GitHub Desktop.
Most useful GoSublime snippet.
"snippets": [
{
"text": "sortby",
"title": "type bySomeOrder []type",
"value": "type $1 []$2\n\nfunc(b $1) Len() int { return len(b) }\nfunc(b $1) Swap(i, j int) { b[i],b[j] = b[j],b[i] }\nfunc(b $1) Less(i, j int) bool { return b[i].$3 < b[j].$3 }"
},
],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment