-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add import cmd #10
base: import-api
Are you sure you want to change the base?
add import cmd #10
Conversation
You have successfully added a new gosec configuration |
for name := range keys { | ||
moduleDir := fmt.Sprintf("%s/%s", dir, name) | ||
// read file to snapshot | ||
snapshot, err := memiavl.OpenSnapshot(moduleDir) | ||
if err != nil { | ||
return err | ||
} | ||
ch := make(chan *iavl.ExportNode) | ||
chanErr := make(chan error) | ||
go func() { | ||
defer close(ch) | ||
exporter := snapshot.Export() | ||
for { | ||
node, err := exporter.Next() | ||
if err == iavl.ExportDone { | ||
break | ||
} | ||
if err != nil { | ||
chanErr <- err | ||
return | ||
} | ||
ch <- node | ||
} | ||
}() | ||
go func() { | ||
moduleDir = fmt.Sprintf("%s/%s", outputDir, name) | ||
err := os.MkdirAll(moduleDir, os.ModePerm) | ||
if err == nil { | ||
err = memiavl.Import(moduleDir, version, ch, true) | ||
} | ||
if err != nil { | ||
panic(err) | ||
} | ||
chanErr <- err | ||
}() | ||
err = <-chanErr | ||
if err != nil { | ||
return err | ||
} | ||
} |
Check failure
Code scanning / gosec
the value in the range statement should be _ unless copying a map: want: for key := range m
👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻
PR Checklist:
make
)make test
)go fmt
)golangci-lint run
)go list -json -m all | nancy sleuth
)Thank you for your code, it's appreciated! :)