vimwiki/tech/Go.wiki

30 lines
598 B
Plaintext
Raw Normal View History

2022-01-25 20:45:01 +00:00
= Go =
Programming language made by google.
== defer ==
2022-01-25 21:00:01 +00:00
`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
}}}