* Update Atomic Counters example to use atomic.Uint64
This commit updates the Atomic Counters example to follow atomic's
recommendation of using atomic.Uint64 instead of uint64 (same for other
types) and then calling methods on it, instead of calling
atomic.AddUint64().
It also updates the comments and empty lines a bit to look better on the
website.
* Run tools/build again
* Fix comments
* Minor addition to if-else text on declarations
Extremely minor addition to if-else text on declarations preceding conditionals, by explicitly clarifying that variables declared are only available in branches succeeding the declaration, not all the branches in the if-else ladder (i.e. preceding branches will not have it in their scope)
This edit might be redundant since variables in Golang can only be used after declaration, but to a complete novice the original wording of "...any variables declared in this statement are available in *all* branches..." might be a little misleading and appear to say that the variable is in-scope for the preceding branches as well (as this seems to be a very Golang-specific semantic that other high-level languages like C/C++, Java, Scala, Kotlin etc don't support; and so it will be a brand new paradigm for developers coming from such languages).
Thanks!
* Increment: Include changes in source .go file for #450
In 1.19, gofmt slightly changes how comments are formatted; a blank `//` is
inserted before `//go:embed` directives.
To accommodate for that in generate.go, treat empty comment lines as
part of docs segments.
* Add embed-directive example and rename embedding to struct-embedding
Signed-off-by: peterzhu1992 <peterzhu1992@gmail.com>
* Minor tweaks
Signed-off-by: peterzhu1992 <peterzhu1992@gmail.com>
* Add some improvements
Signed-off-by: peterzhu1992 <peterzhu1992@gmail.com>
* Add isDir() checks for measure.go and generate.go in tools
Signed-off-by: peterzhu1992 <peterzhu1992@gmail.com>
* Add example of Go generics
Fixes#349
* Remove TODO
* Update public link
* Update GitHub action to only build with 1.18-rc1
1.17 won't successfully build the generics example