Skip to content

Commit 8b7c4cd

Browse files
committed
Enable and fix ineffassign issues
1 parent 5e634df commit 8b7c4cd

5 files changed

Lines changed: 5 additions & 8 deletions

File tree

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
# args: --issues-exit-code=0
3636

3737
# For now, Smart Node will only enforce goimports linting
38-
args: --disable-all --enable goimports --enable staticcheck
38+
args: --disable-all --enable goimports --enable staticcheck --enable ineffassign
3939

4040
# Optional: show only new issues if it's a pull request. The default value is `false`.
4141
# only-new-issues: true

rocketpool-cli/commands/node/utils.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ func promptTimezone() string {
197197
// Prompt for country
198198
country := ""
199199
for {
200-
timezone = ""
201200
country = utils.Prompt("Please enter a country / continent from the list above:", "^.+$", "Please enter a country / continent from the list above:")
202201

203202
exists := false
@@ -257,7 +256,6 @@ func promptTimezone() string {
257256
// Prompt for region
258257
region := ""
259258
for {
260-
timezone = ""
261259
region = utils.Prompt("Please enter a region from the list above:", "^.+$", "Please enter a region from the list above:")
262260

263261
exists := false

rocketpool-cli/commands/odao/proposals.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,8 @@ func getProposals(c *cli.Context, stateFilter string) error {
9292
if bytes.Equal(proposal.ProposerAddress.Bytes(), member.Address.Bytes()) {
9393
fmt.Printf("%d: %s - Proposed by: %s (%s)\n", proposal.ID, proposal.Message, member.ID, proposal.ProposerAddress)
9494
printed = true
95+
break
9596
}
96-
printed = true
97-
break
9897
}
9998
if !printed {
10099
fmt.Printf("%d: %s - Proposed by: %s (no longer on the Oracle DAO)\n", proposal.ID, proposal.Message, proposal.ProposerAddress)

rocketpool-daemon/common/state/network-state.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ func CreateNetworkStateForNode(cfg *config.SmartNodeConfig, rp *rocketpool.Rocke
337337
return nil, nil, fmt.Errorf("error getting Protocol DAO proposal details: %w", err)
338338
}
339339
logger.Info(fmt.Sprintf("%d/%d - Retrieved Protocol DAO proposals", currentStep, steps), slog.Duration(keys.TotalElapsedKey, time.Since(start)))
340-
currentStep++
340+
// If adding more steps below, don't forget to increment currentStep:
341+
// currentStep++
341342

342343
return state, totalEffectiveStake, nil
343344
}

rocketpool-daemon/node/collectors/supply-collector.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ func (c *SupplyCollector) Collect(channel chan<- prometheus.Metric) {
8686
}
8787

8888
// Sync
89-
nodeCount := float64(-1)
9089
nodeFee := state.NetworkDetails.NodeFee
9190
initializedCount := float64(-1)
9291
prelaunchCount := float64(-1)
@@ -95,7 +94,7 @@ func (c *SupplyCollector) Collect(channel chan<- prometheus.Metric) {
9594
finalizedCount := float64(-1)
9695

9796
// Get total number of Rocket Pool nodes
98-
nodeCount = float64(len(state.NodeDetails))
97+
nodeCount := float64(len(state.NodeDetails))
9998

10099
// Get the total number of Rocket Pool minipools
101100
for _, mpd := range state.MinipoolDetails {

0 commit comments

Comments
 (0)