Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stateify
: Add +stateify identtype
tag for identical type definiti…
…ons. This allows serialization of type definitions identical of stateifiable struct types. Context: I want to add a `bpf.Instruction` library which is a type definition of `linux.BPFInstruction` (but with nicer helper functions), and keep its serializability. Sample output for ```go // +stateify savable // +stateify alias:linux.BPFInstruction type Instruction linux.BPFInstruction ``` ```go func (ins *Instruction) StateTypeName() string { return "pkg/bpf.Instruction" } func (ins *Instruction) StateFields() []string { return (*linux.BPFInstruction)(ins).StateFields() } // +checklocksignore func (ins *Instruction) StateSave(stateSinkObject state.Sink) { (*linux.BPFInstruction)(ins).StateSave(stateSinkObject) } // +checklocksignore func (ins *Instruction) StateLoad(stateSourceObject state.Source) { (*linux.BPFInstruction)(ins).StateLoad(stateSourceObject) } ``` PiperOrigin-RevId: 568999266
- Loading branch information