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

Changed bool fields to bool pointers to avoid removal by encoder when set to false #115

Merged
merged 2 commits into from
Dec 7, 2020

Conversation

Static-Flow
Copy link
Contributor

Description

Moves bool fields to bool pointers to avoid "omitempty" deleting bool fields set to false. I created a helper method in govultr.go called BooltoBoolPtr for converting a bool value to a pointer of itself.

func BoolToBoolPtr(value bool) *bool {
	b := value
	return &b
}

Related Issues

#114

Checklist:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you linted your code locally prior to submission?
  • Have you successfully ran tests with your changes locally?

@codecov
Copy link

codecov bot commented Dec 7, 2020

Codecov Report

Merging #115 (823a8d4) into master (e2db4bc) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #115      +/-   ##
==========================================
+ Coverage   49.00%   49.09%   +0.08%     
==========================================
  Files          23       23              
  Lines        1161     1163       +2     
==========================================
+ Hits          569      571       +2     
  Misses        347      347              
  Partials      245      245              
Impacted Files Coverage Δ
bare_metal_server.go 43.51% <ø> (ø)
block_storage.go 54.16% <ø> (ø)
instance.go 41.12% <ø> (ø)
load_balancer.go 40.57% <ø> (ø)
user.go 52.94% <ø> (ø)
govultr.go 80.23% <100.00%> (+0.47%) ⬆️

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 e2db4bc...823a8d4. Read the comment docs.

@ddymko ddymko self-requested a review December 7, 2020 14:52
@ddymko ddymko merged commit 5bc1b0a into vultr:master Dec 7, 2020
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.

2 participants