gopls/internal/lsp/cache: delete unused mustEncode

Change-Id: Id487772ae3d2b252d1b946f42af9520b2c990613
Reviewed-on: https://go-review.googlesource.com/c/tools/+/524840
TryBot-Result: Gopher Robot <gobot@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Auto-Submit: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
diff --git a/gopls/internal/lsp/cache/analysis.go b/gopls/internal/lsp/cache/analysis.go
index 1cfa84d..5676a78 100644
--- a/gopls/internal/lsp/cache/analysis.go
+++ b/gopls/internal/lsp/cache/analysis.go
@@ -1395,14 +1395,6 @@
 	return result
 }
 
-func mustEncode(x interface{}) []byte {
-	var buf bytes.Buffer
-	if err := gob.NewEncoder(&buf).Encode(x); err != nil {
-		log.Fatalf("internal error encoding %T: %v", x, err)
-	}
-	return buf.Bytes()
-}
-
 var analyzeSummaryCodec = frob.CodecFor[*analyzeSummary]()
 
 // -- data types for serialization of analysis.Diagnostic and source.Diagnostic --