Skip to content

Commit

Permalink
Fix reviewdog
Browse files Browse the repository at this point in the history
  • Loading branch information
nao1215 committed Jan 2, 2024
1 parent 984513c commit cf34a69
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 2 additions & 3 deletions app/usecase/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ type S3ObjectsDeleter interface {
DeleteS3Objects(ctx context.Context, input *S3ObjectsDeleterInput) (*S3ObjectsDeleterOutput, error)
}

// S3ObjectDownLoaderInput is the input of the DownloadObject method.
// S3ObjectDownloaderInput is the input of the DownloadObject method.
type S3ObjectDownloaderInput struct {
// Bucket is the name of the bucket that you want to download.
Bucket model.Bucket
// Key is the S3 key.
Key model.S3Key
}

// S3ObjectDownLoaderOutput is the output of the DownloadObject method.
// S3ObjectDownloaderOutput is the output of the DownloadObject method.
type S3ObjectDownloaderOutput struct {
// Bucket is the name of the bucket that you want to download.
Bucket model.Bucket
Expand Down Expand Up @@ -156,4 +156,3 @@ type S3ObjectCopierOutput struct{}
type S3ObjectCopier interface {
CopyS3Object(ctx context.Context, input *S3ObjectCopierInput) (*S3ObjectCopierOutput, error)
}

7 changes: 5 additions & 2 deletions cmd/subcmd/s3hub/cp.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,12 @@ func (c *cpCmd) Do() error {
return c.s3ToLocal()
case copyTypeS3ToS3:
return c.s3ToS3()
case copyTypeUnknown:
default:
return fmt.Errorf("unsupported copy type. from=%s, to=%s", color.YellowString(c.pair.From), color.YellowString(c.pair.To))
return fmt.Errorf("unsupported copy type. from=%s, to=%s",
color.YellowString(c.pair.From), color.YellowString(c.pair.To))
}
return nil
}

// localToS3 copies from local to S3.
Expand All @@ -134,7 +137,7 @@ func (c *cpCmd) localToS3() error {

fileNum := len(targets)
for i, v := range targets {
data, err := os.ReadFile(v)
data, err := os.ReadFile(filepath.Clean(v))
if err != nil {
return err
}
Expand Down

0 comments on commit cf34a69

Please sign in to comment.