Skip to content

Commit

Permalink
vacation godoc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Sophie Wigmore authored and ryanmoran committed Jul 9, 2021
1 parent 353185c commit cdad8b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vacation/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ func NewArchive(inputReader io.Reader) Archive {
//
// Archive decompression will also handle files that are types "text/plain;
// charset=utf-8" and write the contents of the input stream to a file name
// "artifact" in the destination directory.
// specified by the `Archive.WithName()` option (or defaults to "artifact")
// in the destination directory.
func (a Archive) Decompress(destination string) error {
// Convert reader into a buffered read so that the header can be peeked to
// determine the type.
Expand Down Expand Up @@ -83,6 +84,8 @@ func (a Archive) StripComponents(components int) Archive {
return a
}

// WithName provides a way of overriding the name of the file
// that the decompressed file will be copied into.
func (a Archive) WithName(name string) Archive {
a.name = name
return a
Expand Down

0 comments on commit cdad8b1

Please sign in to comment.