vimwiki/tech/Go.wiki

30 lines
598 B
Plaintext

= Go =
Programming language made by google.
== defer ==
`defer` adds the function call after the keyword to a stack. All of the calls
on that stack are called when the function in which they were added returns.
This means that they are called in filo order.
This is useful because we can add the code to cleanup a resource to this
`defer` stack when its initilized, and then we do not have to remember to clean
it up later.
== flag ==
`flag` is a package for parsing cli flags. This supports
{{{
-flag=x
-flag x
--flag=x
--flag x
-boolflag
--boolflag
-boolflag=value
--boolflag=value
}}}