Skip to content

Commit cdad8b1

Browse files
Sophie Wigmoreryanmoran
Sophie Wigmore
authored andcommitted
vacation godoc updates
1 parent 353185c commit cdad8b1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

vacation/archive.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ func NewArchive(inputReader io.Reader) Archive {
3434
//
3535
// Archive decompression will also handle files that are types "text/plain;
3636
// charset=utf-8" and write the contents of the input stream to a file name
37-
// "artifact" in the destination directory.
37+
// specified by the `Archive.WithName()` option (or defaults to "artifact")
38+
// in the destination directory.
3839
func (a Archive) Decompress(destination string) error {
3940
// Convert reader into a buffered read so that the header can be peeked to
4041
// determine the type.
@@ -83,6 +84,8 @@ func (a Archive) StripComponents(components int) Archive {
8384
return a
8485
}
8586

87+
// WithName provides a way of overriding the name of the file
88+
// that the decompressed file will be copied into.
8689
func (a Archive) WithName(name string) Archive {
8790
a.name = name
8891
return a

0 commit comments

Comments
 (0)