/
left76
/
cli
Обзор
Документация
Войти
/
left76
/
cli
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
vendor/github.com/moby/buildkit/session/context.go
22 строки
386 B
Sebastiaan van Stijn
bump moby/moby and dependencies to 14ce1f1cf48e9859223c6311de58aec4dc0f046c
29 сен 2017, 18:44
Не верифицирован
29 сен 2017, 18:44
98dbfee
Код
Авторство
О чём код?
package session import "context" type contextKeyT string var contextKey = contextKeyT("buildkit/session-id") func NewContext(ctx context.Context, id string) context.Context { if id != "" { return context.WithValue(ctx, contextKey, id) } return ctx } func FromContext(ctx context.Context) string { v := ctx.Value(contextKey) if v == nil { return "" } return v.(string) }