AddFile adds the file with the given name (opened using os.Open) to the index. It logs errors using package log.
(name string)
| 104 | // AddFile adds the file with the given name (opened using os.Open) |
| 105 | // to the index. It logs errors using package log. |
| 106 | func (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. |