Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilsol committed Aug 13, 2024
1 parent b38be42 commit b9b5358
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions storage/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
"github.com/pkg/errors"

"github.com/satisfactorymodding/smr-api/redis"
)

Expand Down
6 changes: 2 additions & 4 deletions storage/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package storage
import (
"bytes"
"context"
"fmt"
"io"
"log/slog"
)
Expand All @@ -21,7 +22,6 @@ func initializeWrapper(reader Storage, writer Storage) *Wrapper {

func (w *Wrapper) Get(key string) (io.ReadCloser, error) {
get, err := w.Writer.Get(key)

if err != nil {
return w.Reader.Get(key)
}
Expand Down Expand Up @@ -71,7 +71,7 @@ func (w *Wrapper) Rename(from string, to string) error {
defer get.Close()
all, err := io.ReadAll(get)
if err != nil {
return err
return fmt.Errorf("failed reading file: %w", err)
}

if _, err := w.Writer.Put(context.Background(), from, bytes.NewReader(all)); err != nil {
Expand All @@ -92,7 +92,6 @@ func (w *Wrapper) Delete(key string) error {

func (w *Wrapper) Meta(key string) (*ObjectMeta, error) {
get, err := w.Writer.Meta(key)

if err != nil {
return w.Reader.Meta(key)
}
Expand All @@ -102,7 +101,6 @@ func (w *Wrapper) Meta(key string) (*ObjectMeta, error) {

func (w *Wrapper) List(prefix string) ([]Object, error) {
get, err := w.Writer.List(prefix)

if err != nil {
return w.Reader.List(prefix)
}
Expand Down
5 changes: 3 additions & 2 deletions tests/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package tests

import (
"context"
"testing"

smr "github.com/satisfactorymodding/smr-api/api"
"github.com/satisfactorymodding/smr-api/validation"
"testing"
)

func TestSetup(t *testing.T) {
func TestSetup(_ *testing.T) {
validation.StaticPath = "../static"
ctx, _ := smr.Initialize(context.Background())
smr.Migrate(ctx)
Expand Down

0 comments on commit b9b5358

Please sign in to comment.