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:
parent
dfc4997ede
commit
c39d669230
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user