summaryrefslogtreecommitdiff
path: root/daily/18-May-2025.md
blob: 2ef64b905270bc6547abd32030aa7df095ec7570 (plain)
1
2
3
4
5
6
7
8
9
10
11
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.