snippet for error loop, put it somewhere beneath ~/.config/sublime-text-3/Packages/User
This file contains 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[ | |
var ( | |
// define the variables here that are shared along the steps | |
// most variables should only by defined by the type here | |
// and are assigned inside the steps | |
err error | |
${1:} | |
) | |
steps: | |
for jump := 1; err == nil; jump++ { | |
switch jump - 1 { | |
default: | |
break steps | |
// count a number up for each following step | |
case 0: | |
// assign to err or vars from above | |
// jump to a step by assigning jump to the step number | |
${2:} | |
} | |
} | |
// use err here | |
${3:} | |
]]></content> | |
<tabTrigger>errloop</tabTrigger> | |
<scope>source.go</scope> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment