func (grok *Grok) AddPatternsFromFile(filename string) error { cfilename := C.CString(filename) defer C.free(unsafe.Pointer(cfilename)) ret := C.grok_patterns_import_from_file(grok.grok, cfilename) if ret != C.GROK_OK { return GrokError{ret} } return nil }
func (this *Grok) AddPatternsFromFile(path string) (err error) { path_c := C.CString(path) defer C.free(unsafe.Pointer(path_c)) ret := C.grok_patterns_import_from_file(this.Obj, path_c) if ret != GROK_OK { err = errors.New("Failed to add patterns from file " + path) } return }
func (grok *Grok) AddPatternsFromFile(path string) error { cpath := C.CString(path) defer C.free(unsafe.Pointer(cpath)) ret := C.grok_patterns_import_from_file(grok.g, cpath) if ret != GROK_OK { return errors.New(fmt.Sprintf("Failed to add path %s", path)) } return nil }