Esempio n. 1
0
// 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
}
Esempio n. 2
0
File: cgoso.go Progetto: Greentor/go
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))
	}
}