swig/Examples/test-suite/go/array_member_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

26 lines
459 B
Go

package main
import . "array_member"
func main() {
f := NewFoo()
f.SetData(GetGlobal_data())
for i := 0; i < 8; i++ {
if Get_value(f.GetData(), i) != Get_value(GetGlobal_data(), i) {
panic("Bad array assignment")
}
}
for i := 0; i < 8; i++ {
Set_value(f.GetData(), i, -i)
}
SetGlobal_data(f.GetData())
for i := 0; i < 8; i++ {
if Get_value(f.GetData(), i) != Get_value(GetGlobal_data(), i) {
panic("Bad array assignment")
}
}
}