diff options
author | Jasper Ras <jaspert.ras@gmail.com> | 2025-05-20 07:19:33 +0200 |
---|---|---|
committer | Jasper Ras <jaspert.ras@gmail.com> | 2025-05-20 07:19:33 +0200 |
commit | a61d928b279c5c508aca3bfc7cb14d810c3d75de (patch) | |
tree | 6df664d4b58f1266e2782252547ed35e3c960b34 /daily/18-May-2025.md | |
parent | d4bd3ad4a869c87fcfa4f83b42555a6c8e1bc746 (diff) |
vault backup: 2025-05-20 07:19:33
Diffstat (limited to 'daily/18-May-2025.md')
-rw-r--r-- | daily/18-May-2025.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/daily/18-May-2025.md b/daily/18-May-2025.md new file mode 100644 index 0000000..2ef64b9 --- /dev/null +++ b/daily/18-May-2025.md @@ -0,0 +1,12 @@ +Some programming problems or programs to make for practicing: +- Echo stdin +- Find duplicate lines on stdin or files passed as arguments. Operating on a stream, or slurp all input and do it at once. + +# Further notes on Go +Order of map iteration is unspecified but random in practice to prevent reliance on ordering. +The Scanner type from the bufio package provides an easy way to read input in lines or words. +Map created with `make` is passed by reference. +Package `io/ioutil` exposes `ReadFile` and other io utility functions and types. +Casting works by `type(var)`, e.g `i := 0; string(i)` +Referencing a multi-component package is done through the last component. E.g `ioutil` for the `io/ioutil` package. +Composite literals are the form of `type{...}` they instantiate composite types, so `[]string{"a"}` is also a composite literal.
\ No newline at end of file |