MCPcopy Create free account
hub / github.com/libgit2/git2go / NewIteratorGlob

Method NewIteratorGlob

config.go:204–218  ·  view source on GitHub ↗

NewIteratorGlob creates an iterator over each entry in the configuration whose name matches the given regular expression

(regexp string)

Source from the content-addressed store, hash-verified

202// NewIteratorGlob creates an iterator over each entry in the
203// configuration whose name matches the given regular expression
204func (c *Config) NewIteratorGlob(regexp string) (*ConfigIterator, error) {
205 iter := &ConfigIterator{cfg: c}
206 cregexp := C.CString(regexp)
207 defer C.free(unsafe.Pointer(cregexp))
208
209 runtime.LockOSThread()
210 defer runtime.UnlockOSThread()
211
212 ret := C.git_config_iterator_glob_new(&iter.ptr, c.ptr, cregexp)
213 if ret < 0 {
214 return nil, MakeGitError(ret)
215 }
216
217 return iter, nil
218}
219
220func (c *Config) SetString(name, value string) (err error) {
221 cname := C.CString(name)

Callers

nothing calls this directly

Calls 2

MakeGitErrorFunction · 0.85
freeMethod · 0.80

Tested by

no test coverage detected