chaokunyang opened a new issue, #2574:
URL: https://github.com/apache/fory/issues/2574
### Feature Request
add compile-time check to go generate when struct def changes, to force
users execute `go generate` again
### Is your feature request related to a problem? Please describe
_No response_
### Describe the solution you'd like
GPT prompt: you are a golang expert, how to generate a struct compilation
guard for go generate to forece users execute go geenrate after struct def
changed
example:
```go
type Thing struct { A int32; B *byte; C [3]uint16 json:"c" }
// Code generated by go generate; DO NOT EDIT.
package yourpkg
// Snapshot of Thing's underlying type at generation time.
type _Thing_expected struct {
A int32
B *byte
C [3]uint16 json:"c"
}
// Compile-time check: this conversion is legal only if Thing's underlying
type
// is identical to _Thing_expected (names, order, types, tags).
var _ = func(x Thing) {
_ = _Thing_expected(x)
}
```
### Describe alternatives you've considered
_No response_
### Additional context
_No response_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]