diff options
author | Jasper Ras <jaspert.ras@gmail.com> | 2025-08-03 16:51:35 +0200 |
---|---|---|
committer | Jasper Ras <jaspert.ras@gmail.com> | 2025-08-03 16:51:35 +0200 |
commit | 19150baf3963c234158a79dea8974017bd0c0de4 (patch) | |
tree | fe2d6ff162bde82629b2bad32ec8dc4f22cefd06 /Go Flags.md | |
parent | 8800edbb04ae0e1a015c1aa7aeea62174369a401 (diff) | |
parent | cb2d833329c58d00229056c01538fa097ecb03ca (diff) |
vault backup: 2025-08-03 16:51:35
Diffstat (limited to 'Go Flags.md')
-rw-r--r-- | Go Flags.md | 22 |
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) + } +} +``` |