Skip to content

Commit

Permalink
Merge pull request #6 from 0gajun/fix_readme
Browse files Browse the repository at this point in the history
Fix sample code in README.md
  • Loading branch information
Pam Selle authored Oct 16, 2019
2 parents 3e79299 + e350555 commit 736d208
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ package main

import (
"bytes"
"ioutil"
"io/ioutil"
"log"
"os"

Expand All @@ -40,11 +40,11 @@ import (

func main() {
// First create a buffer for storing the slug.
slug := bytes.NewBuffer(nil)
buf := bytes.NewBuffer(nil)

// Then call the Pack function with a directory path containing the
// configuration files and an io.Writer to write the slug to.
if _, err := Pack("testdata/archive-dir", slug); err != nil {
if _, err := slug.Pack("testdata/archive-dir", buf, false); err != nil {
log.Fatal(err)
}

Expand All @@ -58,7 +58,7 @@ func main() {
// Unpacking a slug is done by calling the Unpack function with an
// io.Reader to read the slug from and a directory path of an existing
// directory to store the unpacked configuration files.
if err := Unpack(slug, dst); err != nil {
if err := slug.Unpack(buf, dst); err != nil {
log.Fatal(err)
}
}
Expand Down

0 comments on commit 736d208

Please sign in to comment.