示例#1
0
文件: r3.go 项目: Bendalexis/go-r3
// 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
}
示例#2
0
文件: cgoso.go 项目: 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))
	}
}