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

libs/os: EnsureDir now returns IO errors and checks file type #5852

Merged
merged 3 commits into from
Jan 4, 2021

Conversation

erikgrinaker
Copy link
Contributor

Fixes #5839.

@erikgrinaker erikgrinaker added the S:automerge Automatically merge PR when requirements pass label Jan 4, 2021
@erikgrinaker erikgrinaker self-assigned this Jan 4, 2021
Copy link
Contributor

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov
Copy link

codecov bot commented Jan 4, 2021

Codecov Report

Merging #5852 (e494b76) into master (91bef75) will increase coverage by 0.04%.
The diff coverage is 40.00%.

@@            Coverage Diff             @@
##           master    #5852      +/-   ##
==========================================
+ Coverage   59.94%   59.99%   +0.04%     
==========================================
  Files         263      263              
  Lines       23817    23822       +5     
==========================================
+ Hits        14277    14291      +14     
+ Misses       8032     8019      -13     
- Partials     1508     1512       +4     
Impacted Files Coverage Δ
abci/client/grpc_client.go 0.00% <0.00%> (ø)
tools/tm-signer-harness/internal/test_harness.go 60.63% <0.00%> (-0.28%) ⬇️
libs/os/os.go 35.29% <50.00%> (+11.96%) ⬆️
crypto/sr25519/pubkey.go 43.47% <0.00%> (-8.70%) ⬇️
mempool/reactor.go 82.50% <0.00%> (-2.50%) ⬇️
p2p/switch.go 65.37% <0.00%> (-2.39%) ⬇️
p2p/transport_mconn.go 41.63% <0.00%> (-2.30%) ⬇️
statesync/snapshots.go 91.59% <0.00%> (-1.69%) ⬇️
blockchain/v0/pool.go 79.84% <0.00%> (-0.39%) ⬇️
consensus/state.go 68.49% <0.00%> (ø)
... and 4 more

Comment on lines +46 to +47
err = os.MkdirAll(dir, mode)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can make this a one-liner

@mergify mergify bot merged commit 9c47b57 into master Jan 4, 2021
@mergify mergify bot deleted the erik/ensuredir-errors branch January 4, 2021 14:30
mergify bot pushed a commit that referenced this pull request Jan 6, 2021
#5852 fixed an issue with error propagation in `os.EnsureDir()`. However, this function is basically identical to `os.MkdirAll()`, and can be replaced entirely with a call to it. We keep the function for backwards compatibility.
erikgrinaker added a commit that referenced this pull request Jan 6, 2021
#5852 fixed an issue with error propagation in `os.EnsureDir()`. However, this function is basically identical to `os.MkdirAll()`, and can be replaced entirely with a call to it. We keep the function for backwards compatibility.
erikgrinaker added a commit that referenced this pull request Jan 6, 2021
#5852 fixed an issue with error propagation in `os.EnsureDir()`. However, this function is basically identical to `os.MkdirAll()`, and can be replaced entirely with a call to it. We keep the function for backwards compatibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S:automerge Automatically merge PR when requirements pass
Projects
None yet
3 participants