// Get tokens in the path func (e *MatchEntry) Vars() []string { var length int = int(C.getVarsLength(e.entry)) var tokens []string = make([]string, length) for i := 0; i < length; i++ { tokens[i] = C.GoString(C.getVar(e.entry, C.int(i))) } return tokens }
func Test() { const want = "Hello world" got := C.GoString(C.getVar()) if got != want { panic(fmt.Sprintf("testExportedVar: got %q, but want %q", got, want)) } got = C.GoString(C.exported_var) if got != want { panic(fmt.Sprintf("testExportedVar: got %q, but want %q", got, want)) } }