mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-29 03:41:45 +00:00
Merge pull request #3572 from nspcc-dev/feat/add-for-range-linter
.golangci.yml: add `intrange` linter
This commit is contained in:
commit
d9a6a7cd3f
6 changed files with 9 additions and 9 deletions
|
@ -51,6 +51,7 @@ linters:
|
|||
- decorder
|
||||
- durationcheck
|
||||
- errorlint
|
||||
- intrange
|
||||
- copyloopvar
|
||||
- gofmt
|
||||
- misspell
|
||||
|
|
|
@ -142,7 +142,7 @@ func Sign(h hash.Hashable) []byte {
|
|||
// SignCommittee signs data by a majority of committee members.
|
||||
func SignCommittee(h hash.Hashable) []byte {
|
||||
buf := io.NewBufBinWriter()
|
||||
for i := 0; i < CommitteeSize()/2+1; i++ {
|
||||
for i := range CommitteeSize()/2 + 1 {
|
||||
pKey := PrivateKey(i)
|
||||
sig := pKey.SignHashable(uint32(Network()), h)
|
||||
if len(sig) != 64 {
|
||||
|
|
|
@ -116,7 +116,7 @@ func TestRemoveOldTransfers(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
require.NotEqual(t, 0, len(log.Raw))
|
||||
|
||||
for i := uint32(0); i < 3; i++ {
|
||||
for i := range uint32(3) {
|
||||
log, err = bc.dao.GetTokenTransferLog(acc2, newer, i, false)
|
||||
require.NoError(t, err)
|
||||
require.NotEqual(t, 0, len(log.Raw))
|
||||
|
@ -130,7 +130,7 @@ func TestRemoveOldTransfers(t *testing.T) {
|
|||
require.NoError(t, err)
|
||||
require.NotEqual(t, 0, len(log.Raw))
|
||||
|
||||
for i := uint32(0); i < 2; i++ {
|
||||
for i := range uint32(2) {
|
||||
log, err = bc.dao.GetTokenTransferLog(acc3, newer, i, true)
|
||||
require.NoError(t, err)
|
||||
require.NotEqual(t, 0, len(log.Raw))
|
||||
|
|
|
@ -13,14 +13,13 @@ func lcp(a, b []byte) []byte {
|
|||
return lcp(b, a)
|
||||
}
|
||||
|
||||
var i int
|
||||
for i = 0; i < len(b); i++ {
|
||||
for i := range b {
|
||||
if a[i] != b[i] {
|
||||
break
|
||||
return b[:i]
|
||||
}
|
||||
}
|
||||
|
||||
return a[:i]
|
||||
return b
|
||||
}
|
||||
|
||||
func lcpMany(kv []keyValue) []byte {
|
||||
|
|
|
@ -821,7 +821,7 @@ func TestNEO_GetCandidates(t *testing.T) {
|
|||
for i := range len(expected) + 1 {
|
||||
w := io.NewBufBinWriter()
|
||||
emit.AppCall(w.BinWriter, neoCommitteeInvoker.Hash, "getAllCandidates", callflag.All)
|
||||
for j := 0; j < i+1; j++ {
|
||||
for range i + 1 {
|
||||
emit.Opcodes(w.BinWriter, opcode.DUP)
|
||||
emit.Syscall(w.BinWriter, interopnames.SystemIteratorNext)
|
||||
emit.Opcodes(w.BinWriter, opcode.DROP) // drop the value returned from Next.
|
||||
|
|
|
@ -1860,7 +1860,7 @@ func (v *VM) ContractHasTryBlock() bool {
|
|||
if ictx.sc != topctx.sc {
|
||||
return false // Different contract -> no one cares.
|
||||
}
|
||||
for j := 0; j < ictx.tryStack.Len(); j++ {
|
||||
for j := range ictx.tryStack.Len() {
|
||||
eCtx := ictx.tryStack.Peek(j).Value().(*exceptionHandlingContext)
|
||||
if eCtx.State == eTry {
|
||||
return true
|
||||
|
|
Loading…
Reference in a new issue