Repository: kopia/kopia
Pull request #3664 (2024-02-20 22:50:38)

refactor(general): remove unused context.Context field

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/kopia/kopia/pull/3664?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Comparison is base [(`cb455c6`)](https://app.codecov.io/gh/kopia/kopia/commit/cb455c699a04e54cb47e25a676d7d65063ce883e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia) 75.86% compared to head [(`c0cf409`)](https://app.codecov.io/gh/kopia/kopia/pull/3664?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia) 77.14%.
> Report is 20 commits behind head on master.


<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##           master    #3664      +/-   ##
==========================================
+ Coverage   75.86%   77.14%   +1.28%     
==========================================
  Files         470      470              
  Lines       37301    28446    -8855     
==========================================
- Hits        28299    21946    -6353     
+ Misses       7071     4571    -2500     
+ Partials     1931     1929       -2     
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/kopia/kopia/pull/3664?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=kopia).


Patch:
diff --git a/debug/debug.go b/internal/pproflogging/pproflogging.go
similarity index 98%
rename from debug/debug.go
rename to internal/pproflogging/pproflogging.go
index 6c19c348..9debd663 100644
--- a/debug/debug.go
+++ b/internal/pproflogging/pproflogging.go
@@ -1,5 +1,5 @@
-// Package debug for debug helper functions.
-package debug
+// Package pproflogging for pproflogging helper functions.
+package pproflogging
 
 import (
 	"bufio"
@@ -20,7 +20,7 @@
 	"github.com/kopia/kopia/repo/logging"
 )
 
-var log = logging.Module("kopia/debug")
+var log = logging.Module("kopia/pproflogging")
 
 // ProfileName the name of the profile (see: runtime/pprof/Lookup).
 type ProfileName string
diff --git a/repo/format/format_manager.go b/repo/format/format_manager.go
index 48b375dc..9c7d75e3 100644
--- a/repo/format/format_manager.go
+++ b/repo/format/format_manager.go
@@ -9,7 +9,6 @@
 
 	"github.com/pkg/errors"
 
-	"github.com/kopia/kopia/internal/ctxutil"
 	"github.com/kopia/kopia/internal/feature"
 	"github.com/kopia/kopia/internal/gather"
 	"github.com/kopia/kopia/repo/blob"
@@ -25,12 +24,10 @@
 
 // Manager manages the contents of `kopia.repository` and `kopia.blobcfg`.
 type Manager struct {
-	//nolint:containedctx
-	ctx           context.Context // +checklocksignore
-	blobs         blob.Storage    // +checklocksignore
-	validDuration time.Duration   // +checklocksignore
-	password      string          // +checklocksignore
-	cache         blobCache       // +checklocksignore
+	blobs         blob.Storage  // +checklocksignore
+	validDuration time.Duration // +checklocksignore
+	password      string        // +checklocksignore
+	cache         blobCache     // +checklocksignore
 
 	// provider for immutable parts of the format data, used to avoid locks.
 	immutable Provider
@@ -402,7 +399,6 @@ func NewManagerWithCache(
 	}
 
 	m := &Manager{
-		ctx:                       ctxutil.Detach(ctx),
 		blobs:                     st,
 		validDuration:             validDuration,
 		password:                  password,


Test patch:
diff --git a/debug/debug_test.go b/internal/pproflogging/pproflogging_test.go
similarity index 99%
rename from debug/debug_test.go
rename to internal/pproflogging/pproflogging_test.go
index b423a661..06dceef0 100644
--- a/debug/debug_test.go
+++ b/internal/pproflogging/pproflogging_test.go
@@ -1,4 +1,4 @@
-package debug
+package pproflogging
 
 import (
 	"fmt"