Merge pull request #5 from markbates/move-stuff

anymore
This commit is contained in:
Mark Bates 2019-10-16 12:30:34 -04:00 committed by GitHub
commit 54ddd3d25c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 7 deletions

View File

@ -9,7 +9,7 @@ import (
"github.com/markbates/pkger"
"github.com/markbates/pkger/here"
"github.com/markbates/pkger/parser"
"github.com/markbates/pkger/pkging/mem"
"github.com/markbates/pkger/pkging/stuffing"
)
const outName = "pkged.go"
@ -140,7 +140,7 @@ func Package(out string, paths []here.Path) error {
}
fmt.Fprintf(f, "\nvar _ = pkger.Apply(mem.UnmarshalEmbed([]byte(`")
if err := mem.Stuff(f, c, paths); err != nil {
if err := stuffing.Stuff(f, c, paths); err != nil {
return err
}

View File

@ -1,4 +1,4 @@
package mem
package mem_test
import (
"bytes"
@ -8,6 +8,8 @@ import (
"github.com/markbates/pkger/here"
"github.com/markbates/pkger/parser"
"github.com/markbates/pkger/pkging/mem"
"github.com/markbates/pkger/pkging/stuffing"
"github.com/stretchr/testify/require"
)
@ -41,10 +43,10 @@ func Test_Pkger_Embedding(t *testing.T) {
bb := &bytes.Buffer{}
err = Stuff(bb, info, paths)
err = stuffing.Stuff(bb, info, paths)
r.NoError(err)
pkg, err := UnmarshalEmbed(bb.Bytes())
pkg, err := mem.UnmarshalEmbed(bb.Bytes())
r.NoError(err)
var res []string

View File

@ -1,9 +1,10 @@
package mem
package stuffing
import (
"io"
"github.com/markbates/pkger/here"
"github.com/markbates/pkger/pkging/mem"
"github.com/markbates/pkger/pkging/stdos"
)
@ -13,7 +14,7 @@ func Stuff(w io.Writer, cur here.Info, paths []here.Path) error {
return err
}
pkg, err := New(cur)
pkg, err := mem.New(cur)
if err != nil {
return err
}