Skip to content

ituoga/appcontext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

appcontext

usage:

package main

import "github.com/ituoga/appcontext"

var localeKey = appcontext.Key[string]("localKey")

func WithLocale(ctx context.Context, locale string) context.Context {
	return appcontext.With(ctx, localeKey, locale)
}

func Locale(ctx context.Context) (string, bool) {
	return appcontext.Get(ctx, localeKey)
}

or check appcontext_test.go

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages