From 61e97372df9cb32ac3c65f29a661cfec475bc113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Wed, 3 Mar 2021 12:24:52 +0100 Subject: [PATCH] api/cloud: remove magic constants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UploadTypes_* constants are auto-generated from the openapi spec. Signed-off-by: Ondřej Budai --- internal/cloudapi/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/cloudapi/server.go b/internal/cloudapi/server.go index cd37e8907..2337bc5b5 100644 --- a/internal/cloudapi/server.go +++ b/internal/cloudapi/server.go @@ -171,7 +171,7 @@ func (server *Server) Compose(w http.ResponseWriter, r *http.Request) { } uploadRequest := (ir.UploadRequests)[0] /* oneOf is not supported by the openapi generator so marshal and unmarshal the uploadrequest based on the type */ - if uploadRequest.Type == "aws" { + if uploadRequest.Type == UploadTypes_aws { var awsUploadOptions AWSUploadRequestOptions jsonUploadOptions, err := json.Marshal(uploadRequest.Options) if err != nil { @@ -205,7 +205,7 @@ func (server *Server) Compose(w http.ResponseWriter, r *http.Request) { } targets = append(targets, t) - } else if uploadRequest.Type == "gcp" { + } else if uploadRequest.Type == UploadTypes_gcp { var gcpUploadOptions GCPUploadRequestOptions jsonUploadOptions, err := json.Marshal(uploadRequest.Options) if err != nil {