Skip to content

Instantly share code, notes, and snippets.

@jarcoal
Last active October 23, 2022 02:13
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jarcoal/7328154 to your computer and use it in GitHub Desktop.
Save jarcoal/7328154 to your computer and use it in GitHub Desktop.
Golang Sublime Snippets
<snippet>
<content><![CDATA[
assert.Equal(t, ${1:err}, nil)
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>aerr</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.go</scope>
</snippet>
<snippet>
<content><![CDATA[
assert.NotEqual(t, ${1:err}, nil)
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>anerr</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.go</scope>
</snippet>
<snippet>
<content><![CDATA[
if err != nil {
${1:return err}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>err</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.go</scope>
</snippet>
<snippet>
<content><![CDATA[
if ${1:err} := ${2:condition}; err != nil {
${3:return err}
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>iferr</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.go</scope>
</snippet>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment