Commit Graph

2 Commits

Author SHA1 Message Date
Abhinav Gupta
ddc304d531 Implement fmt.Stringer for atomic types (#76)
Add safe `String()` methods for atomic types that replicate the same
behavior as `fmt.Sprintf("%v", x.Load())` without the allocations.

As with json.Marshaler/Unmarshaler, we've omitted the `atomic.Value`
type for now.

Resolves #50
2020-05-14 16:26:08 -07:00
Abhinav Gupta
08f23f163e Generate atomic Value wrappers automatically
Rather than hand-writing wrappers around atomic.Value, generate them
automatically from the same template. The generator is at
internal/gen-valuewrapper. The generator correctly handles generating
wrapper structs for nillable types.
2020-05-12 11:30:18 -07:00