(dbPath string)
| 1155 | } |
| 1156 | |
| 1157 | func wipeSQLiteFiles(dbPath string) error { |
| 1158 | removeIfExists := func(path string) error { |
| 1159 | err := os.Remove(path) |
| 1160 | if err == nil || errors.Is(err, fs.ErrNotExist) { |
| 1161 | return nil |
| 1162 | } |
| 1163 | return err |
| 1164 | } |
| 1165 | if err := removeIfExists(dbPath); err != nil { |
| 1166 | return err |
| 1167 | } |
| 1168 | if err := removeIfExists(dbPath + "-wal"); err != nil { |
| 1169 | return err |
| 1170 | } |
| 1171 | if err := removeIfExists(dbPath + "-shm"); err != nil { |
| 1172 | return err |
| 1173 | } |
| 1174 | return nil |
| 1175 | } |
| 1176 | |
| 1177 | type Cache struct { |
| 1178 | // callsMu protects in-flight call bookkeeping and arbitrary in-memory call maps. |
no test coverage detected