mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 01:42:25 -05: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:
parent
0dbe6c514f
commit
adbc87700a
23 changed files with 329 additions and 865 deletions
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()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue