Skip to content

Commit c7bcca1

Browse files
committed
add comment for ziptree package
1 parent f877403 commit c7bcca1

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

ziptree/zipper.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package ziptree contains code to zip a directory tree and write it out.
12
package ziptree
23

34
import (
@@ -10,6 +11,7 @@ import (
1011
"time"
1112
)
1213

14+
// Option for zipping
1315
type Option func(*config)
1416

1517
type config struct {
@@ -21,18 +23,21 @@ func newConfig() *config {
2123
return &config{Compress: true}
2224
}
2325

26+
// Compress is an Option to compress a zip or not
2427
func Compress(f bool) Option {
2528
return func(c *config) {
2629
c.Compress = f
2730
}
2831
}
2932

33+
// FixMtime is an Option to fix mtimes of the file in the zip
3034
func FixMtime(t time.Time) Option {
3135
return func(c *config) {
3236
c.Mtime = t
3337
}
3438
}
3539

40+
// Zip a directory tree
3641
func Zip(srcPath string, opts ...Option) ([]byte, error) {
3742
c := newConfig()
3843
for _, opt := range opts {

0 commit comments

Comments
 (0)