diff --git a/imagecompression.go b/imagecompression.go index 87032c7..cf6702c 100644 --- a/imagecompression.go +++ b/imagecompression.go @@ -19,7 +19,7 @@ type Tinify struct { key string } -func (t Tinify) Compress(url string) (location string, err error) { +func (t *Tinify) Compress(url string) (location string, err error) { fileExtension := func() string { spliced := strings.Split(url, ".") return spliced[len(spliced)-1] diff --git a/mediastorage.go b/mediastorage.go index 8cabfb3..6bd4702 100644 --- a/mediastorage.go +++ b/mediastorage.go @@ -26,7 +26,7 @@ type BunnyCdnStorage struct { var bunnyCdnStorageUrl = "https://storage.bunnycdn.com" -func (b BunnyCdnStorage) Upload(fileName string, file multipart.File) (location string, err error) { +func (b *BunnyCdnStorage) Upload(fileName string, file multipart.File) (location string, err error) { client := &http.Client{} req, _ := http.NewRequest(http.MethodPut, bunnyCdnStorageUrl+"/"+url.PathEscape(b.storageZoneName)+"/"+url.PathEscape("/"+fileName), file) req.Header.Add("AccessKey", b.key)