(ctx context.Context, version *VersionInfo)
| 5 | var ContextKey = struct{ string }{"version"} |
| 6 | |
| 7 | func WithContext(ctx context.Context, version *VersionInfo) context.Context { |
| 8 | return context.WithValue(ctx, ContextKey, version) |
| 9 | } |
| 10 | |
| 11 | func FromContext(ctx context.Context) *VersionInfo { |
| 12 | if c, ok := ctx.Value(ContextKey).(*VersionInfo); ok { |