swig/Examples/test-suite/go/li_std_vector_ptr_runme.go
Ian Lance Taylor 8a1c09e280 Fix Go tests to run in module mode
Stop using relative imports and add a go.mod file.

Tested against Go 1.6 through Go pre-1.13, and gccgo.
2019-04-24 21:43:38 -07:00

19 lines
369 B
Go

package main
import . "li_std_vector_ptr"
import "fmt"
func check(val1 int, val2 int) {
if val1 != val2 {
panic(fmt.Sprintf("Values are not the same %d %d", val1, val2))
}
}
func main() {
ip1 := MakeIntPtr(11)
ip2 := MakeIntPtr(22)
vi := NewIntPtrVector()
vi.Add(ip1)
vi.Add(ip2)
check(GetValueFromVector(vi, 0), 11)
check(GetValueFromVector(vi, 1), 22)
}