Skip to content

Instantly share code, notes, and snippets.

@metakeule
Created January 14, 2015 11:22
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save metakeule/da078aab13a81efc1311 to your computer and use it in GitHub Desktop.
snippet for error loop, put it somewhere beneath ~/.config/sublime-text-3/Packages/User
<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