From 31a046fd68343e3298f7716c11099ab81e7a2039 Mon Sep 17 00:00:00 2001
From: Pior Bastida <pior@pbastida.net>
Date: Sun, 25 Aug 2024 19:59:29 +0200
Subject: [PATCH] Remove ContextValues (supported by stdlib since 1.21)

---
 context.go      | 21 ---------------------
 context_test.go | 25 -------------------------
 2 files changed, 46 deletions(-)
 delete mode 100644 context.go
 delete mode 100644 context_test.go

diff --git a/context.go b/context.go
deleted file mode 100644
index 1204eaa..0000000
--- a/context.go
+++ /dev/null
@@ -1,21 +0,0 @@
-package runnable
-
-import (
-	"context"
-)
-
-// ContextValues returns a new context.Context with the values from the parent, without propagating the cancellation.
-// Useful when you want to protect an operation that should not be cancelled.
-// Often used with context.WithTimeout() or context.WithDeadline().
-func ContextValues(parent context.Context) context.Context {
-	return valuesCtx{context.Background(), parent}
-}
-
-type valuesCtx struct {
-	context.Context
-	parent context.Context
-}
-
-func (c valuesCtx) Value(key interface{}) interface{} {
-	return c.parent.Value(key)
-}
diff --git a/context_test.go b/context_test.go
deleted file mode 100644
index 54fa0c7..0000000
--- a/context_test.go
+++ /dev/null
@@ -1,25 +0,0 @@
-package runnable
-
-import (
-	"context"
-	"testing"
-
-	"github.com/stretchr/testify/require"
-)
-
-type testingContextType string
-
-func TestContextValues(t *testing.T) {
-	key := testingContextType("key")
-
-	parent := context.Background()
-	parent = context.WithValue(parent, key, "value")
-	parent, cancel := context.WithCancel(parent)
-	cancel()
-
-	require.Error(t, parent.Err())
-
-	ctx := ContextValues(parent)
-	require.Equal(t, "value", ctx.Value(key))
-	require.NoError(t, ctx.Err())
-}