From f73ed91f004265e45412a32cbf258cc99eb849b0 Mon Sep 17 00:00:00 2001 From: Liran Funaro Date: Sun, 21 Jun 2026 13:40:41 +0300 Subject: [PATCH] [dependency] Remove unmaintained library spew from production code Signed-off-by: Liran Funaro --- common/ledger/blkstorage/blockfile_helper.go | 3 +-- common/ledger/blkstorage/blockfile_mgr.go | 5 ++--- common/ledger/blkstorage/reset_test.go | 3 +-- go.mod | 2 +- go.sum | 3 +-- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/common/ledger/blkstorage/blockfile_helper.go b/common/ledger/blkstorage/blockfile_helper.go index f2d95c466..bbb992f58 100644 --- a/common/ledger/blkstorage/blockfile_helper.go +++ b/common/ledger/blkstorage/blockfile_helper.go @@ -12,7 +12,6 @@ import ( "strconv" "strings" - "github.com/davecgh/go-spew/spew" "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/pkg/errors" "google.golang.org/protobuf/proto" @@ -81,7 +80,7 @@ func constructBlockfilesInfo(rootDir string) (*blockfilesInfo, error) { latestFileNumber: lastFileNum, noBlockFiles: lastFileNum == 0 && numBlocksInFile == 0, } - logger.Debugf("blockfilesInfo constructed from file system = %s", spew.Sdump(blkfilesInfo)) + logger.Debugf("blockfilesInfo constructed from file system = %v", blkfilesInfo) return blkfilesInfo, nil } diff --git a/common/ledger/blkstorage/blockfile_mgr.go b/common/ledger/blkstorage/blockfile_mgr.go index 4a974fc58..a57d32880 100644 --- a/common/ledger/blkstorage/blockfile_mgr.go +++ b/common/ledger/blkstorage/blockfile_mgr.go @@ -13,7 +13,6 @@ import ( "sync" "sync/atomic" - "github.com/davecgh/go-spew/spew" "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/hyperledger/fabric-protos-go-apiv2/peer" "github.com/pkg/errors" @@ -111,7 +110,7 @@ func newBlockfileMgr(id string, conf *Conf, indexConfig *IndexConfig, indexStore if blockfilesInfo, err = constructBlockfilesInfo(rootDir); err != nil { panic(fmt.Sprintf("Could not build blockfilesInfo info from block files: %s", err)) } - logger.Debugf("Info constructed by scanning the blocks dir = %s", spew.Sdump(blockfilesInfo)) + logger.Debugf("Info constructed by scanning the blocks dir = %v", blockfilesInfo) } else { logger.Debug(`Syncing block information from block storage (if needed)`) syncBlockfilesInfoFromFS(rootDir, blockfilesInfo) @@ -637,7 +636,7 @@ func (mgr *blockfileMgr) retrieveTransactionByID(txID string) (*common.Envelope, return mgr.fetchTransactionEnvelope(loc) } -func (mgr *blockfileMgr) retrieveTransactionByBlockNumTranNum(blockNum uint64, tranNum uint64) (*common.Envelope, error) { +func (mgr *blockfileMgr) retrieveTransactionByBlockNumTranNum(blockNum, tranNum uint64) (*common.Envelope, error) { logger.Debugf("retrieveTransactionByBlockNumTranNum() - blockNum = [%d], tranNum = [%d]", blockNum, tranNum) if blockNum < mgr.firstPossibleBlockNumberInBlockFiles() { return nil, errors.Errorf( diff --git a/common/ledger/blkstorage/reset_test.go b/common/ledger/blkstorage/reset_test.go index 64385c28e..881ddaee4 100644 --- a/common/ledger/blkstorage/reset_test.go +++ b/common/ledger/blkstorage/reset_test.go @@ -11,7 +11,6 @@ import ( "path" "testing" - "github.com/davecgh/go-spew/spew" "github.com/hyperledger/fabric-protos-go-apiv2/common" "github.com/stretchr/testify/require" "google.golang.org/protobuf/encoding/protowire" @@ -221,7 +220,7 @@ func assertBlocksDirOnlyFileWithGenesisBlock(t *testing.T, ledgerDir string, gen func assertBlockStorePostReset(t *testing.T, store *BlockStore, originallyCommittedBlocks []*common.Block) { bcInfo, _ := store.GetBlockchainInfo() - t.Logf("bcInfo = %s", spew.Sdump(bcInfo)) + t.Logf("bcInfo = %v", bcInfo) require.True(t, proto.Equal( &common.BlockchainInfo{ Height: 1, diff --git a/go.mod b/go.mod index d3708926e..c1670cd23 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,6 @@ require ( github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible github.com/alecthomas/kingpin/v2 v2.4.0 github.com/cockroachdb/errors v1.12.0 - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/go-viper/mapstructure/v2 v2.5.0 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.8.0 @@ -56,6 +55,7 @@ require ( github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/consensys/gnark-crypto v0.20.1 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect github.com/dnephin/pflag v1.0.7 // indirect github.com/fatih/color v1.18.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect diff --git a/go.sum b/go.sum index 1f1b1a9c3..eaf2dc2f8 100644 --- a/go.sum +++ b/go.sum @@ -42,9 +42,8 @@ github.com/consensys/gnark-crypto v0.20.1 h1:PXDUBvk8AzhvWowHLWBEAfUQcV1/aZgWIqD github.com/consensys/gnark-crypto v0.20.1/go.mod h1:RBWrSgy+IDbGR69RRV313th3M/aZU1ubk2om+qHuTSc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= -github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dnephin/pflag v1.0.7 h1:oxONGlWxhmUct0YzKTgrpQv9AUA1wtPBn7zuSjJqptk= github.com/dnephin/pflag v1.0.7/go.mod h1:uxE91IoWURlOiTUIA8Mq5ZZkAv3dPUfZNaT80Zm7OQE= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=