From 9fe49f4d512a998155e03551486fc7727e0bf8a8 Mon Sep 17 00:00:00 2001 From: Tyler Perkins Date: Tue, 25 Jan 2022 16:00:01 -0500 Subject: [PATCH] Update for 25-01-22 16:00 --- lang/Go.wiki | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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 + }}}