Created
September 23, 2014 12:53
-
-
Save xlab/55a28197edfb748f0ad9 to your computer and use it in GitHub Desktop.
GoSort snippet for Sublime Text https://medium.com/@kouprianov/gosort-snippet-for-sublime-text-c18b817125f2
This file contains hidden or 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
<snippet> | |
<content><![CDATA[ | |
type ${1:type}s []*${1:type} | |
func (s ${1:type}s) Len() int { return len(s) } | |
func (s ${1:type}s) Swap(i, j int) { s[i], s[j] = s[j], s[i] } | |
func (s ${1:type}s) Less(i, j int) bool { return s[i].${2:field} < s[j].${2:field} } | |
]]></content> | |
<tabTrigger>gosort</tabTrigger> | |
<scope>source.go</scope> | |
<description>Insert slice sorting routines</description> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment