change reader exmple to show usage of SetPassword

This commit is contained in:
alexmullins 2015-10-29 17:15:39 -05:00
parent 678a885320
commit e7e638f095
1 changed files with 5 additions and 1 deletions

View File

@ -5,12 +5,13 @@
package zip_test
import (
"archive/zip"
"bytes"
"fmt"
"io"
"log"
"os"
"github.com/alexmullins/zip"
)
func ExampleWriter() {
@ -57,6 +58,9 @@ func ExampleReader() {
// Iterate through the files in the archive,
// printing some of their contents.
for _, f := range r.File {
// if f.IsEncrypted() {
// f.SetPassword([]byte("password"))
// }
fmt.Printf("Contents of %s:\n", f.Name)
rc, err := f.Open()
if err != nil {