MCPcopy Index your code
hub / github.com/google/codesearch / AddFile

Method AddFile

index/write.go:106–114  ·  view source on GitHub ↗

AddFile adds the file with the given name (opened using os.Open) to the index. It logs errors using package log.

(name string)

Source from the content-addressed store, hash-verified

104// AddFile adds the file with the given name (opened using os.Open)
105// to the index. It logs errors using package log.
106func (ix *IndexWriter) AddFile(name string) {
107 f, err := os.Open(name)
108 if err != nil {
109 log.Print(err)
110 return
111 }
112 defer f.Close()
113 ix.Add(name, f)
114}
115
116// Add adds the file f to the index under the given name.
117// It logs errors using package log.

Callers 1

mainFunction · 0.80

Calls 1

AddMethod · 0.95

Tested by

no test coverage detected