Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/frioux/geneg


https://github.com/frioux/geneg

Last synced: 19 days ago
JSON representation

Awesome Lists containing this project

README

        

Example package using `go generate`.

Run `go build` and then the built binary. Note the error. Now run
`go generate`. Note the new file in the repo. Feel free to look at it's
contents. Run `go build` again and then run the built binary.

By the way, setting a string like this with `go generate` is probably overkill,
since `go build -ldflags "-X 'main.compiledAt=whatever'"` would do that more
simply, but there are times when that isn't an option, or when the structure
being generated is more complex than a simple string.