1
0
mirror of https://github.com/golang/go synced 2024-11-11 20:40:21 -07:00

archive/tar: set Header.Mode in example

Creating a tar containing files with 0000 permission bits is
not going to be useful.

Change-Id: Ie489c2891c335d32270b18f37b0e32ecdca536a6
Reviewed-on: https://go-review.googlesource.com/3271
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Shenghou Ma 2015-01-25 19:01:58 -05:00 committed by Minux Ma
parent dfc4997ede
commit c39d669230

View File

@ -31,6 +31,7 @@ func Example() {
for _, file := range files {
hdr := &tar.Header{
Name: file.Name,
Mode: 0600,
Size: int64(len(file.Body)),
}
if err := tw.WriteHeader(hdr); err != nil {