diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index e39a091672..ec1a859436 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -88,7 +88,6 @@ jobs: -c .golangci-warnings.yml \ --issues-exit-code 0 \ --allow-parallel-runners > temp_golangci-lint-cgo.txt - cat temp_golangci-lint-cgo.txt cat temp_golangci-lint-cgo.txt | reviewdog \ -f=golangci-lint \ @@ -102,4 +101,4 @@ jobs: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} run: | curl -X POST --data-urlencode "payload={\"text\": \"Reviewdog failed. ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \"}" $SLACK_WEBHOOK - if: ${{ failure() && (contains(github.ref_name, 'rel/nightly') || contains(github.ref_name, 'rel/beta') || contains(github.ref_name, 'rel/stable') || contains(github.ref_name, 'master')) }} \ No newline at end of file + if: ${{ failure() && (contains(github.ref_name, 'rel/nightly') || contains(github.ref_name, 'rel/beta') || contains(github.ref_name, 'rel/stable') || contains(github.ref_name, 'master')) }} diff --git a/.golangci-warnings.yml b/.golangci-warnings.yml index e3b8d22ff2..f8d2063475 100644 --- a/.golangci-warnings.yml +++ b/.golangci-warnings.yml @@ -9,10 +9,8 @@ linters: - partitiontest - structcheck - varcheck - - unconvert - unused - linters-settings: custom: partitiontest: @@ -55,7 +53,6 @@ issues: - deadcode - structcheck - varcheck - - unconvert - unused # Add all linters here -- Comment this block out for testing linters - path: test/linttest/lintissues\.go @@ -63,7 +60,6 @@ issues: - deadcode - structcheck - varcheck - - unconvert - unused - path: crypto/secp256k1/secp256_test\.go linters: diff --git a/agreement/events_test.go b/agreement/events_test.go index 1ea35fa800..c558f0067b 100644 --- a/agreement/events_test.go +++ b/agreement/events_test.go @@ -21,6 +21,7 @@ import ( "testing" "github.com/algorand/go-algorand/protocol" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" ) @@ -28,6 +29,7 @@ import ( // properly decoded from ConsensusVersionView. // This test is only needed for agreement state serialization switch from reflection to msgp. func TestSerializableErrorBackwardCompatibility(t *testing.T) { + partitiontest.PartitionTest(t) encodedEmpty, err := base64.StdEncoding.DecodeString("gqNFcnLAp1ZlcnNpb26jdjEw") require.NoError(t, err) diff --git a/agreement/persistence_test.go b/agreement/persistence_test.go index ef5d5da47c..fbd9323b09 100644 --- a/agreement/persistence_test.go +++ b/agreement/persistence_test.go @@ -240,6 +240,7 @@ func TestEmptyMapDeserialization(t *testing.T) { } func TestDecodeFailures(t *testing.T) { + partitiontest.PartitionTest(t) clock := timers.MakeMonotonicClock(time.Date(2015, 1, 2, 5, 6, 7, 8, time.UTC)) ce := clock.Encode() log := makeServiceLogger(logging.Base()) diff --git a/cmd/goal/formatting_test.go b/cmd/goal/formatting_test.go index 58a8d6d0de..f368c54c9a 100644 --- a/cmd/goal/formatting_test.go +++ b/cmd/goal/formatting_test.go @@ -72,6 +72,7 @@ func TestNewBoxRef(t *testing.T) { } func TestStringsToBoxRefs(t *testing.T) { + partitiontest.PartitionTest(t) brs := stringsToBoxRefs([]string{"77,str:hello", "55,int:6", "int:88"}) require.EqualValues(t, 77, brs[0].appID) require.EqualValues(t, 55, brs[1].appID) diff --git a/cmd/tealdbg/dryrunRequest.go b/cmd/tealdbg/dryrunRequest.go index 1ff43981a9..5f13aa6cfe 100644 --- a/cmd/tealdbg/dryrunRequest.go +++ b/cmd/tealdbg/dryrunRequest.go @@ -47,23 +47,6 @@ func ddrFromParams(dp *DebugParams) (ddr v2.DryrunRequest, err error) { return } -func convertAccounts(accounts []model.Account) (records []basics.BalanceRecord, err error) { - for _, a := range accounts { - var addr basics.Address - addr, err = basics.UnmarshalChecksumAddress(a.Address) - if err != nil { - return - } - var ad basics.AccountData - ad, err = v2.AccountToAccountData(&a) - if err != nil { - return - } - records = append(records, basics.BalanceRecord{Addr: addr, AccountData: ad}) - } - return -} - func balanceRecordsFromDdr(ddr *v2.DryrunRequest) (records []basics.BalanceRecord, err error) { accounts := make(map[basics.Address]basics.AccountData) for _, a := range ddr.Accounts { diff --git a/config/config_test.go b/config/config_test.go index ebddd5a57a..c2ee070fc4 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -582,6 +582,7 @@ func TestGetNonDefaultConfigValues(t *testing.T) { } func TestLocal_TxFiltering(t *testing.T) { + partitiontest.PartitionTest(t) cfg := GetDefaultLocal() // ensure the default diff --git a/daemon/algod/api/server/v2/errors.go b/daemon/algod/api/server/v2/errors.go index 2db2d51edc..947a38fa97 100644 --- a/daemon/algod/api/server/v2/errors.go +++ b/daemon/algod/api/server/v2/errors.go @@ -29,14 +29,12 @@ var ( errFailedRetrievingLatestBlockHeaderStatus = "failed retrieving latests block header" errFailedRetrievingSyncRound = "failed retrieving sync round from ledger" errFailedSettingSyncRound = "failed to set sync round on the ledger" - errSyncModeNotEnabled = "sync mode must be enabled" errFailedParsingFormatOption = "failed to parse the format option" errFailedToParseAddress = "failed to parse the address" errFailedToParseExclude = "failed to parse exclude" errFailedToParseTransaction = "failed to parse transaction" errFailedToParseBlock = "failed to parse block" errFailedToParseCert = "failed to parse cert" - errFailedToParseSourcemap = "failed to parse sourcemap" errFailedToEncodeResponse = "failed to encode response" errInternalFailure = "internal failure" errNoValidTxnSpecified = "no valid transaction ID was specified" diff --git a/logging/telemetryspec/metric_test.go b/logging/telemetryspec/metric_test.go index 170b6a60cd..85693bdbab 100644 --- a/logging/telemetryspec/metric_test.go +++ b/logging/telemetryspec/metric_test.go @@ -56,6 +56,8 @@ func TestTransactionProcessingTimeDistributionFormatting(t *testing.T) { } func TestTransactionProcessingTimeDistributionPrint(t *testing.T) { + partitiontest.PartitionTest(t) + var decPT transactionProcessingTimeDistribution expected := "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38]" require.NoError(t, json.Unmarshal([]byte(expected), &decPT)) diff --git a/shared/pingpong/pingpong.go b/shared/pingpong/pingpong.go index 9e6dc27c26..32352bcfcb 100644 --- a/shared/pingpong/pingpong.go +++ b/shared/pingpong/pingpong.go @@ -14,6 +14,9 @@ // You should have received a copy of the GNU Affero General Public License // along with go-algorand. If not, see . +// Package pingpong provides a transaction generating utility for performance testing. +// +//nolint:unused,structcheck,deadcode,varcheck // ignore unused pingpong code package pingpong import ( diff --git a/util/rateLimit.go b/util/rateLimit.go index 3fbd50c3f7..c4e85c71e7 100644 --- a/util/rateLimit.go +++ b/util/rateLimit.go @@ -65,9 +65,8 @@ type capacityQueue chan capacity // ErlCapacityGuard is the structure returned to clients so they can release the capacity when needed // they also inform the congestion manager of events type ErlCapacityGuard struct { - client ErlClient - cq capacityQueue - cm CongestionManager + cq capacityQueue + cm CongestionManager } // Release will put capacity back into the queue attached to this capacity guard diff --git a/util/tcpinfo_linux.go b/util/tcpinfo_linux.go index 5c332643ee..8cf1687aed 100644 --- a/util/tcpinfo_linux.go +++ b/util/tcpinfo_linux.go @@ -56,6 +56,7 @@ func getConnTCPInfo(raw syscall.RawConn) (*TCPInfo, error) { // linuxTCPInfo is based on linux include/uapi/linux/tcp.h struct tcp_info //revive:disable:var-naming +//nolint:structcheck // complains about unused fields that are rqeuired to match C tcp_info struct type linuxTCPInfo struct { state uint8 ca_state uint8