Skip to content

Commit 3a39601

Browse files
authored
feat: Add Pointer() utility method to value.Value[T] (#16)
1 parent 8bafc2e commit 3a39601

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

pkg/tree/value/value.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ func (v Value[T]) IsEmpty() bool {
139139
return empty == v.Value()
140140
}
141141

142+
func (v Value[T]) Pointer() *T {
143+
x := v.Value()
144+
return &x
145+
}
146+
142147
func (v Value[T]) Value() T {
143148
var zero T
144149
if v.proto == nil {

0 commit comments

Comments
 (0)