Skip to content

Commit

Permalink
Address review
Browse files Browse the repository at this point in the history
  • Loading branch information
Arief Rahmansyah committed Dec 8, 2023
1 parent 5dee870 commit 1b50b7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions api/pkg/artifact/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Service interface {
ParseURL(gsURL string) (*URL, error)

ReadArtifact(ctx context.Context, url string) ([]byte, error)
WriteArtifact(ctx context.Context, url, content string) error
WriteArtifact(ctx context.Context, url string, content []byte) error
DeleteArtifact(ctx context.Context, url string) error
}

Expand Down Expand Up @@ -88,14 +88,14 @@ func (gac *GcsArtifactClient) ReadArtifact(ctx context.Context, url string) ([]b
return bytes, nil
}

func (gac *GcsArtifactClient) WriteArtifact(ctx context.Context, url, content string) error {
func (gac *GcsArtifactClient) WriteArtifact(ctx context.Context, url string, content []byte) error {
u, err := gac.ParseURL(url)
if err != nil {
return err
}
w := gac.API.Bucket(u.Bucket).Object(u.Object).NewWriter(ctx)

if _, err := fmt.Fprint(w, content); err != nil {
if _, err := fmt.Fprintf(w, "%s", content); err != nil {
return err
}

Expand Down Expand Up @@ -147,7 +147,7 @@ func (nac *NopArtifactClient) ReadArtifact(ctx context.Context, url string) ([]b
return nil, nil
}

func (nac *NopArtifactClient) WriteArtifact(ctx context.Context, url, content string) error {
func (nac *NopArtifactClient) WriteArtifact(ctx context.Context, url string, content []byte) error {
return nil
}

Expand Down
4 changes: 2 additions & 2 deletions api/pkg/artifact/mocks/artifact.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1b50b7f

Please sign in to comment.