[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:
kim
2023-01-06 10:16:09 +00:00
committed by GitHub
parent 0dbe6c514f
commit adbc87700a
23 changed files with 329 additions and 865 deletions

View File

@@ -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()
}