- Notifications
You must be signed in to change notification settings - Fork1k
chore(coderd): extract fileszip to its own package for reuse#15229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
funcTestTarFileBytes() []byte { | ||
returnappend([]byte{},testTarFileBytes...) | ||
} | ||
funcTestZipFileBytes() []byte { | ||
returnappend([]byte{},testZipFileBytes...) | ||
} |
There was a problem hiding this comment.
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
//go:embed testdata/test.tar | ||
vartestTarFileBytes []byte | ||
//go:embed testdata/test.zip | ||
vartestZipFileBytes []byte |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
review: I chose togo:embed
these so that we don't end up with silly path errors.
There was a problem hiding this 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.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
df34858
intomainUh oh!
There was an error while loading.Please reload this page.
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.