Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Janez Podhostnik <67895329+janezpodhostnik@users.noreply.github.com>
  • Loading branch information
zhangchiqing and janezpodhostnik committed Jan 18, 2024
1 parent dda516f commit 028ff6a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cmd/util/cmd/read-badger/cmd/find-block-by-commits/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func Init(f func() (*storage.All, *badger.DB)) *cobra.Command {
_ = cmd.MarkFlagRequired("end-height")

cmd.Flags().StringVar(&flagStateCommitments, "state-commitments", "",
"State commitments (each must be 64 chars, hex-encoded)")
"Comma separated list of state commitments (each must be 64 chars, hex-encoded)")
_ = cmd.MarkFlagRequired("state-commitments")

return cmd
Expand Down Expand Up @@ -116,7 +116,12 @@ func run(*cobra.Command, []string) {
}

storage, db := loader()
defer db.Close()
defer func () {

Check failure on line 119 in cmd/util/cmd/read-badger/cmd/find-block-by-commits/main.go

View workflow job for this annotation

GitHub Actions / Lint (./)

File is not `goimports`-ed with -local github.com/onflow/flow-go (goimports)
err := db.Close()
if err != nil {
log.Warn().Err(err).Msg("error closing db")
}
}()

_, err = FindBlockIDByCommits(
log.Logger,
Expand Down

0 comments on commit 028ff6a

Please sign in to comment.