move "link or copy" functionality to moxio

and add a bit more logging for unexpected failures when closing files.
and make tests pass with a TMPDIR on a different filesystem than the testdata directory.
This commit is contained in:
Mechiel Lukkien
2023-07-23 12:15:29 +02:00
parent 4a4d337ab4
commit 3e9b4107fd
12 changed files with 165 additions and 144 deletions

View File

@ -59,14 +59,14 @@ var adminapiJSON []byte
//go:embed admin.html
var adminHTML []byte
var adminDoc = mustParseAPI(adminapiJSON)
var adminDoc = mustParseAPI("admin", adminapiJSON)
var adminSherpaHandler http.Handler
func mustParseAPI(buf []byte) (doc sherpadoc.Section) {
func mustParseAPI(api string, buf []byte) (doc sherpadoc.Section) {
err := json.Unmarshal(buf, &doc)
if err != nil {
xlog.Fatalx("parsing api docs", err)
xlog.Fatalx("parsing api docs", err, mlog.Field("api", api))
}
return doc
}