Skip to content
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

Open
wants to merge 1 commit into
base: import-api
Choose a base branch
from
Open

add import cmd #10

wants to merge 1 commit into from

Conversation

mmsqe
Copy link

@mmsqe mmsqe commented Mar 27, 2023

👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻

PR Checklist:

  • Have you read the CONTRIBUTING.md?
  • Does your PR follow the C4 patch requirements?
  • Have you rebased your work on top of the latest master?
  • Have you checked your code compiles? (make)
  • Have you included tests for any non-trivial functionality?
  • Have you checked your code passes the unit tests? (make test)
  • Have you checked your code formatting is correct? (go fmt)
  • Have you checked your basic code style is fine? (golangci-lint run)
  • If you added any dependencies, have you checked they do not contain any known vulnerabilities? (go list -json -m all | nancy sleuth)
  • If your changes affect the client infrastructure, have you run the integration test?
  • If your changes affect public APIs, does your PR follow the C4 evolution of public contracts?
  • If your code changes public APIs, have you incremented the crate version numbers and documented your changes in the CHANGELOG.md?
  • If you are contributing for the first time, please read the agreement in CONTRIBUTING.md now and add a comment to this pull request stating that your PR is in accordance with the Developer's Certificate of Origin.

Thank you for your code, it's appreciated! :)

@github-advanced-security
Copy link

You have successfully added a new gosec configuration .github/workflows/gosec.yml:Gosec. As part of the setup process, we have scanned this repository and found 107 existing alerts. Please check the repository Security tab to see all alerts.

Comment on lines +40 to +79
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

expected exactly 1 statement (either append, delete, or copying to another map) in a range with a map, got 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant