mirror of
https://github.com/mudler/luet.git
synced 2025-09-06 01:30:29 +00:00
Update gomod and vendor
This commit is contained in:
22
vendor/github.com/moby/buildkit/session/context.go
generated
vendored
Normal file
22
vendor/github.com/moby/buildkit/session/context.go
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
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)
|
||||
}
|
Reference in New Issue
Block a user