| 116 | } |
| 117 | |
| 118 | func buildFlushIndex(out string, paths []string, doFlush bool, fileData map[string]string) { |
| 119 | ix := Create(out) |
| 120 | ix.AddPaths(paths) |
| 121 | var files []string |
| 122 | for name := range fileData { |
| 123 | files = append(files, name) |
| 124 | } |
| 125 | sort.Strings(files) |
| 126 | for _, name := range files { |
| 127 | ix.Add(name, strings.NewReader(fileData[name])) |
| 128 | } |
| 129 | if doFlush { |
| 130 | ix.flushPost() |
| 131 | } |
| 132 | ix.Flush() |
| 133 | } |
| 134 | |
| 135 | func buildIndex(name string, paths []string, fileData map[string]string) { |
| 136 | buildFlushIndex(name, paths, false, fileData) |