writeIndex marshals the index into JSON and writes the file to the Git repo. It returns any errors associated with marshaling the data or writing the file.
(index map[string]int64, sha string)
| 228 | // writeIndex marshals the index into JSON and writes the file to the Git repo. |
| 229 | // It returns any errors associated with marshaling the data or writing the file. |
| 230 | func (gh *Storage) writeIndex(index map[string]int64, sha string) error { |
| 231 | contents, err := json.Marshal(index) |
| 232 | if err != nil { |
| 233 | return err |
| 234 | } |
| 235 | |
| 236 | return gh.writeFile(fs.IndexName, sha, contents) |
| 237 | } |
| 238 | |
| 239 | // Store stores results in the Git repo & updates the index. |
| 240 | func (gh *Storage) Store(results []types.Result) error { |