summaryrefslogtreecommitdiff
path: root/Go Flags.md
diff options
context:
space:
mode:
Diffstat (limited to 'Go Flags.md')
-rw-r--r--Go Flags.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/Go Flags.md b/Go Flags.md
new file mode 100644
index 0000000..07af1f6
--- /dev/null
+++ b/Go Flags.md
@@ -0,0 +1,22 @@
+[[Golang]]
+
+---
+
+Flags!
+
+```go
+package main
+
+import "flag"
+
+var n = flag.Bool("n", false, "omit trailing newline")
+var sep = flag.String("s", " ", "seperator")
+
+func main() {
+ flag.Parse()
+
+ if *n {
+ strings.Split("blaat", *sep)
+ }
+}
+```