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

dont't panic when marshal from nil or unmarshal to nil interface or pointer #353

Merged
merged 1 commit into from Apr 15, 2020

Conversation

AllenX2018
Copy link
Contributor

This pr avoid go-toml panic when calling Marshal(v interface{}) or Unmarshal(data []byte, v interface{}) with nil or nil-pointer as v, just return an error in these cases.

@codecov
Copy link

codecov bot commented Apr 9, 2020

Codecov Report

Merging #353 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #353      +/-   ##
==========================================
+ Coverage   94.92%   94.94%   +0.01%     
==========================================
  Files          10       10              
  Lines        2087     2095       +8     
==========================================
+ Hits         1981     1989       +8     
  Misses         64       64              
  Partials       42       42              
Impacted Files Coverage Δ
marshal.go 94.15% <100.00%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e8d2a6...46bf688. Read the comment docs.

@pelletier
Copy link
Owner

Good idea, thank you for taking care of this!

@pelletier pelletier merged commit 145b183 into pelletier:master Apr 15, 2020
@pelletier pelletier added the bug Issues describing a bug in go-toml. label Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues describing a bug in go-toml.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants