Skip to content

Commit

Permalink
Fix DeepSource error
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldwan committed Oct 11, 2023
1 parent 2c19e29 commit 5f2b45c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tools/distribute/bundle/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/pkg/errors"
)

func CreateReleaseBundle(meta Meta, w io.WriteCloser) (*archive, error) {
func CreateReleaseBundle(meta Meta, w io.WriteCloser) (*Archive, error) {
archive := newArchive(w)
defer archive.Close()

Expand All @@ -28,18 +28,18 @@ func CreateReleaseBundle(meta Meta, w io.WriteCloser) (*archive, error) {
return archive, nil
}

func newArchive(w io.WriteCloser) *archive {
func newArchive(w io.WriteCloser) *Archive {
gw := gzip.NewWriter(w)
tw := tar.NewWriter(gw)
return &archive{tw, gw}
return &Archive{tw, gw}
}

type archive struct {
type Archive struct {
tw *tar.Writer
gq *gzip.Writer
}

func (a *archive) WriteJSON(thing any, name string) error {
func (a *Archive) WriteJSON(thing any, name string) error {
data, err := json.Marshal(thing)
if err != nil {
return err
Expand All @@ -61,7 +61,7 @@ func (a *archive) WriteJSON(thing any, name string) error {
return nil
}

func (a *archive) WriteFile(path string) error {
func (a *Archive) WriteFile(path string) error {
file, err := os.Open(path)
if err != nil {
return err
Expand Down Expand Up @@ -91,6 +91,6 @@ func (a *archive) WriteFile(path string) error {
return nil
}

func (a *archive) Close() error {
func (a *Archive) Close() error {
return multierror.Append(nil, a.tw.Close(), a.gq.Close())
}

0 comments on commit 5f2b45c

Please sign in to comment.