mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore] pull in latest go-cache, go-runners versions (#1306)
Signed-off-by: kim <grufwub@gmail.com> Signed-off-by: kim <grufwub@gmail.com>
This commit is contained in:
20
vendor/codeberg.org/gruf/go-runners/context.go
generated
vendored
20
vendor/codeberg.org/gruf/go-runners/context.go
generated
vendored
@@ -12,6 +12,11 @@ var closedctx = func() context.Context {
|
||||
return ctx
|
||||
}()
|
||||
|
||||
// Closed returns an always closed context.
|
||||
func Closed() context.Context {
|
||||
return closedctx
|
||||
}
|
||||
|
||||
// ContextWithCancel returns a new context.Context impl with cancel.
|
||||
func ContextWithCancel() (context.Context, context.CancelFunc) {
|
||||
ctx := make(cancelctx)
|
||||
@@ -41,3 +46,18 @@ func (ctx cancelctx) Err() error {
|
||||
func (cancelctx) Value(key interface{}) interface{} {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ctx cancelctx) String() string {
|
||||
var state string
|
||||
select {
|
||||
case <-ctx:
|
||||
state = "closed"
|
||||
default:
|
||||
state = "open"
|
||||
}
|
||||
return "cancelctx{state:" + state + "}"
|
||||
}
|
||||
|
||||
func (ctx cancelctx) GoString() string {
|
||||
return "runners." + ctx.String()
|
||||
}
|
||||
|
Reference in New Issue
Block a user