/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
go/chat/s3/ctx.go
22 строки
517 B
zoom-ua
remove golang.org/x/net/context in favor of context (#28708)
17 дек 2025, 18:24
Не верифицирован
17 дек 2025, 18:24
67b0ffe
Код
Авторство
О чём код?
package s3 import "context" // ctxkey is for getting values out of context.Context type ctxkey int // fakeS3Key is the context key to determine if we're using the fakeS3 server. const fakeS3Key ctxkey = 0 // NewFakeS3Context returns a context with the fakeS3Key flag set. func NewFakeS3Context(ctx context.Context) context.Context { return context.WithValue(ctx, fakeS3Key, true) } func UsingFakeS3(ctx context.Context) bool { fake, ok := ctx.Value(fakeS3Key).(bool) if !ok { return false } return fake }