From 9025a72233b8d55f2e7c1cd495e5088f10e47e09 Mon Sep 17 00:00:00 2001 From: Gianmaria Del Monte Date: Tue, 21 Feb 2023 09:52:33 +0100 Subject: [PATCH] fix linter --- pkg/ocm/storage/ocm.go | 10 +++++----- tests/helpers/helpers.go | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pkg/ocm/storage/ocm.go b/pkg/ocm/storage/ocm.go index 810f940a997..860adbbbfa2 100644 --- a/pkg/ocm/storage/ocm.go +++ b/pkg/ocm/storage/ocm.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, @@ -273,8 +273,8 @@ func (d *driver) ListFolder(ctx context.Context, ref *provider.Reference, _ []st } func (d *driver) InitiateUpload(ctx context.Context, ref *provider.Reference, _ int64, _ map[string]string) (map[string]string, error) { - shareId, rel := shareInfoFromReference(ref) - p := getPathFromShareIDAndRelPath(shareId, rel) + shareID, rel := shareInfoFromReference(ref) + p := getPathFromShareIDAndRelPath(shareID, rel) return map[string]string{ "simple": p, @@ -301,10 +301,10 @@ func (d *driver) Download(ctx context.Context, ref *provider.Reference) (io.Read } func (d *driver) GetPathByID(ctx context.Context, id *provider.ResourceId) (string, error) { - shareId, rel := shareInfoFromReference(&provider.Reference{ + shareID, rel := shareInfoFromReference(&provider.Reference{ ResourceId: id, }) - return getPathFromShareIDAndRelPath(shareId, rel), nil + return getPathFromShareIDAndRelPath(shareID, rel), nil } func (d *driver) Shutdown(ctx context.Context) error { diff --git a/tests/helpers/helpers.go b/tests/helpers/helpers.go index fb8c9d3c137..ee61297eecb 100644 --- a/tests/helpers/helpers.go +++ b/tests/helpers/helpers.go @@ -109,6 +109,7 @@ func Upload(ctx context.Context, fs storage.FS, ref *provider.Reference, content return err } +// UploadGateway uploads in one step a the content in a file. func UploadGateway(ctx context.Context, gw gatewayv1beta1.GatewayAPIClient, ref *provider.Reference, content []byte) error { res, err := gw.InitiateFileUpload(ctx, &provider.InitiateFileUploadRequest{ Ref: ref, @@ -146,6 +147,7 @@ func UploadGateway(ctx context.Context, gw gatewayv1beta1.GatewayAPIClient, ref return nil } +// Download downloads the content of a file in one step. func Dowload(ctx context.Context, gw gatewayv1beta1.GatewayAPIClient, ref *provider.Reference) ([]byte, error) { res, err := gw.InitiateFileDownload(ctx, &provider.InitiateFileDownloadRequest{ Ref: ref,