1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-02-08 04:28:32 +00:00

api: Add NullImage

This commit is contained in:
diamondburned 2022-02-17 13:05:15 -08:00
parent 6dc189519c
commit 209e6282b0
No known key found for this signature in database
GPG key ID: D78C4471CE776659

View file

@ -28,11 +28,14 @@ type Image struct {
// ContentType is optional and will be automatically detected. However, it
// should always return "image/jpeg," "image/png" or "image/gif".
ContentType string
// Just raw content of the file.
Content []byte
}
// NullImage is an *Image value that marshals to a null value. Use this to unset
// the image. It exists mostly for documentation purposes.
var NullImage = &Image{}
func DecodeImage(data []byte) (*Image, error) {
parts := bytes.SplitN(data, []byte{';'}, 2)
if len(parts) < 2 {