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
commit 6f5c045284
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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
}