diff --git a/lang/Go.wiki b/lang/Go.wiki index a309957..22ce20d 100644 --- a/lang/Go.wiki +++ b/lang/Go.wiki @@ -4,4 +4,26 @@ Programming language made by google. == defer == -`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 + }}}