diff --git a/cmd/files.com-test/main.go b/cmd/files.com-test/main.go index 36a3ccd..a2c970f 100644 --- a/cmd/files.com-test/main.go +++ b/cmd/files.com-test/main.go @@ -38,10 +38,7 @@ func main() { if *uploadFile != "" { filename := filepath.Base(*uploadFile) fileClient := file.Client{Config: filesConfig} - status, err := fileClient.UploadFile(context.Background(), &file.UploadParams{Source: *uploadFile, Destination: filepath.Join(*path, filename)}) - if err != nil { - fmt.Printf("Error uploading file %s: %s", *uploadFile, err) - } + status := fileClient.UploadFile(context.Background(), &file.UploadParams{Source: *uploadFile, Destination: filepath.Join(*path, filename)}) fmt.Println(status.Files()) } diff --git a/go.mod b/go.mod index 8de23d1..7d16872 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/canonical/athena-core go 1.22 require ( - github.com/Files-com/files-sdk-go v1.1.1145 + github.com/Files-com/files-sdk-go v1.2.1218 github.com/flosch/pongo2/v4 v4.0.2 github.com/lileio/pubsub/v2 v2.6.1 github.com/makyo/snuffler v0.0.0-20190210075944-33446730a4fe diff --git a/go.sum b/go.sum index a3b4918..3311f23 100644 --- a/go.sum +++ b/go.sum @@ -50,8 +50,8 @@ github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/datadog-go v2.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/Files-com/files-sdk-go v1.1.1145 h1:XmrD0805kGbLIQ0pKpSOZIw7B2a3GV4XHkgDR+HBAIE= -github.com/Files-com/files-sdk-go v1.1.1145/go.mod h1:/qeqiWrGdmRwnHi3ySD9sQ9dgaxBCmvb68a9irT6568= +github.com/Files-com/files-sdk-go v1.2.1218 h1:cPkbrxfplVT5letzggHMCoChNORhG1zCdDLD8euMwrE= +github.com/Files-com/files-sdk-go v1.2.1218/go.mod h1:Fo/MOSJTSB52Bx9GlxeIJCquS4J6WqvTurcLVM8fNWU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= @@ -117,7 +117,6 @@ github.com/flosch/pongo2/v4 v4.0.2 h1:gv+5Pe3vaSVmiJvh/BZa82b7/00YUGm0PIyVVLop0H github.com/flosch/pongo2/v4 v4.0.2/go.mod h1:B5ObFANs/36VwxxlgKpdchIJHMvHB562PW+BWPhwZD8= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= diff --git a/pkg/common/files-com.go b/pkg/common/files-com.go index 4e7fa48..02d6214 100644 --- a/pkg/common/files-com.go +++ b/pkg/common/files-com.go @@ -38,10 +38,7 @@ func (client *BaseFilesComClient) Upload(contents, destinationPath string) (*fil return nil, err } defer os.Remove(tmpfile.Name()) - status, err := client.ApiClient.UploadFile(context.Background(), &file.UploadParams{Source: tmpfile.Name(), Destination: destinationPath}) - if err != nil { - return nil, err - } + status := client.ApiClient.UploadFile(context.Background(), &file.UploadParams{Source: tmpfile.Name(), Destination: destinationPath}) return &status.Files()[0], nil }