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

Type.Equals: prevent crash when comparing NilType #76

Merged
merged 1 commit into from
Nov 10, 2020
Merged

Type.Equals: prevent crash when comparing NilType #76

merged 1 commit into from
Nov 10, 2020

Conversation

radeksimko
Copy link
Contributor

This is useful in combination with https://github.com/zclconf/go-cty-debug and https://github.com/google/go-cmp when comparing structs which may have cty.Type field which is optional, i.e. NilType is a valid value in that particular context.

@codecov
Copy link

codecov bot commented Nov 9, 2020

Codecov Report

❗ No coverage uploaded for pull request base (main@3293c1b). Click here to learn what that means.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #76   +/-   ##
=======================================
  Coverage        ?   70.35%           
=======================================
  Files           ?       79           
  Lines           ?     6540           
  Branches        ?        0           
=======================================
  Hits            ?     4601           
  Misses          ?     1496           
  Partials        ?      443           
Impacted Files Coverage Δ
cty/type.go 77.41% <100.00%> (ø)
cty/function/unpredictable.go 100.00% <0.00%> (ø)
cty/element_iterator.go 95.18% <0.00%> (ø)
cty/set/set.go 63.63% <0.00%> (ø)
cty/function/stdlib/sequence.go 75.78% <0.00%> (ø)
cty/json/unmarshal.go 55.69% <0.00%> (ø)
cty/unknown.go 82.35% <0.00%> (ø)
cty/function/stdlib/bytes.go 45.45% <0.00%> (ø)
cty/function/stdlib/string.go 50.90% <0.00%> (ø)
cty/null.go 100.00% <0.00%> (ø)
... and 70 more

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 3293c1b...06f7ca8. Read the comment docs.

Copy link
Collaborator

@apparentlymart apparentlymart left a comment

Choose a reason for hiding this comment

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

Seems reasonable! Thanks.

@apparentlymart apparentlymart merged commit 1338293 into zclconf:main Nov 10, 2020
@radeksimko radeksimko deleted the fix-type-nil-equals branch November 10, 2020 06:59
radeksimko added a commit to hashicorp/terraform-schema that referenced this pull request Nov 10, 2020
radeksimko added a commit to hashicorp/terraform-schema that referenced this pull request Nov 10, 2020
radeksimko added a commit to hashicorp/terraform-schema that referenced this pull request Nov 10, 2020
* schema: add versioned schemas for some blocks

* Reduce repetition between versions

* bump go-cty to latest (patched) revision

zclconf/go-cty#76
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