* 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
Standard library time package has support for UnixMilli - https://pkg.go.dev/time#Time.UnixMilli
Updated the example to use the method on Time instead of calculating.
* feat: Add benchmark example
Adds a simple benchmark example and its invocation.
* fix: Address PR comments
- Clarify meaning of `b.N`.
- Nix verbose flag in run example.
* fix: Reword b.N comment
* fix: Missing period