This commit is contained in:
Mark Bates 2019-10-16 11:13:11 -04:00
parent 4e9c2f821e
commit 07332a91c3
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
}