Big restructuring and initial work on activitypub
This commit is contained in:
Tobi Smethurst
2021-05-08 14:25:55 +02:00
committed by GitHub
parent ac9adb172b
commit 6f5c045284
183 changed files with 7391 additions and 5414 deletions

View File

@@ -22,6 +22,7 @@ import (
"bytes"
"io"
"mime/multipart"
"net/url"
"os"
)
@@ -62,3 +63,13 @@ func CreateMultipartFormData(fieldName string, fileName string, extraFields map[
}
return b, w, nil
}
// URLMustParse tries to parse the given URL and panics if it can't.
// Should only be used in tests.
func URLMustParse(stringURL string) *url.URL {
u, err := url.Parse(stringURL)
if err != nil {
panic(err)
}
return u
}