Commit e012b8e
Paddy Carver
Flesh out the As method.
The As method on tftypes.Values was essentially useless, because As is
the only way to get to the underlying Go types beneath a Value, but As
takes a Value as its argument, and As is the only thing you can call on
a Value. So there was nothing you could actually do inside your
Unmarshaler method because As only supported Unmarshalers. So As would
call your Unmarshaler which could only call As which could only call
your Unmarshaler and so on and so forth.
This implements some basic Go type support for the canonical Go
representations of all the tftypes Types, so we can get to them in our
Unmarshaler methods or just use them with As directly.1 parent 95da7fb commit e012b8e
1 file changed
+43
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
42 | | - | |
| 43 | + | |
43 | 44 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 45 | + | |
| 46 | + | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
49 | 87 | | |
50 | 88 | | |
51 | 89 | | |
| |||
0 commit comments