Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

johnstcn
Copy link
Member

Related to #15087
As part of sniffing the workspace tags from an uploaded file, we need to be able to handle both zip and tar files. Extracting the functions in the fileszip package will be helpful here.

@johnstcn johnstcn self-assigned this Oct 25, 2024
Comment on lines 22 to 28
func TestTarFileBytes() []byte {
return append([]byte{}, testTarFileBytes...)
}

func TestZipFileBytes() []byte {
return append([]byte{}, testZipFileBytes...)
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review: returning a clone of the byte to avoid accidental mutation in tests

Comment on lines 16 to 20
//go:embed testdata/test.tar
var testTarFileBytes []byte

//go:embed testdata/test.zip
var testZipFileBytes []byte
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review: I chose to go:embed these so that we don't end up with silly path errors.

@johnstcn johnstcn requested review from defelmnq and mafredri October 25, 2024 12:01
Copy link
Member

@mafredri mafredri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nits but otherwise LGTM.

@johnstcn johnstcn merged commit df34858 into main Oct 25, 2024
26 checks passed
@johnstcn johnstcn deleted the cj/extract-pkg-fileszip branch October 25, 2024 14:14
@github-actions github-actions bot locked and limited conversation to collaborators Oct 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants