gotypes,build: pointer dereference (#61)

Provides a method on `gotypes.Component` to allow pointer dereference. This will enable `gotypes` helpers to be used with struct pointer arguments, for example.

Updates #53 
Fixes #54
This commit is contained in:
Michael McLoughlin
2019-01-27 19:22:21 -08:00
committed by GitHub
parent eb225e9d2c
commit 9eb409b935
9 changed files with 137 additions and 29 deletions

View File

@@ -1,6 +1,7 @@
package args
import (
"math"
"testing"
"testing/quick"
)
@@ -36,3 +37,12 @@ func TestFunctionsEqual(t *testing.T) {
}
}
}
func TestDereferenceFloat32(t *testing.T) {
expect := float32(math.Pi)
s := Struct{Float32: expect}
got := DereferenceFloat32(&s)
if got != expect {
t.Errorf("DereferenceFloat32(%v) = %v; expect %v", s, got, expect)
}
}