Make GetAttribute use reflection #134
Labels
breaking-change
This PR introduces a breaking change or the resolution of this issue may require a breaking change.
enhancement
New feature or request
reflection
Issues and PRs about the reflection subsystem used to convert between attr.Values and Go values.
Milestone
Module version
Use-cases
See #46.
Attempted Solutions
#46
Proposal
Rather than having
GetAttribute
return anattr.Value
, let's mirrorGet
and have it take atarget interface{}
that it reflects into. Otherwise, people are just going to need to usetfsdk.ValueOf
or type-assert out of it anyways, so there's no real point in surfacing theattr.Value
version. If people want theattr.Value
, they can maketarget
anattr.Value
implementation, so I don't know that we lose anything here.This lets us mirror #133 for
reflect.Into
and mirrors howSetAttribute
works, so it just feels more consistent.References
The text was updated successfully, but these errors were encountered: