mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user