markphelps / optional

Optional is a library of optional Go types
https://godoc.org/github.com/markphelps/optional
MIT License
210 stars 19 forks source link

"generated by robots at {{ .Timestamp }}" Makes File Generation Non-Deterministic #22

Closed DannyHinshaw closed 2 years ago

DannyHinshaw commented 2 years ago

Can we remove this comment or at least remove the timestamp from the generation tool?

Consider a project that has a lot of separate files containing types that need optional types generated. Ideally, one could run go generate on the whole directory and only files that changed would be updated, however, this comment will update every generated file with the new timestamp whether the type had any changes or not. This creates a mess that then needs cleaned up before committing to git. It's a really big annoyance for no real benefit, we don't need the timestamp comment, we have git for that.

https://github.com/markphelps/optional/blob/7069a2a687ee438ce2c71785a20762fa487082ac/cmd/optional/main.go#L129

DannyHinshaw commented 2 years ago

thank you!