WithLocale creates a new context with the passed locale
(ctx context.Context, locale *Locale)
| 14 | |
| 15 | // WithLocale creates a new context with the passed locale |
| 16 | func WithLocale(ctx context.Context, locale *Locale) context.Context { |
| 17 | return context.WithValue(ctx, tokenKey, locale) |
| 18 | } |
| 19 | |
| 20 | // FromCtx returns the locale from the context. |
| 21 | // The returned locale is always not nil. |
searching dependent graphs…