forked from mirror/pkger
anymore
This commit is contained in:
parent
4e9c2f821e
commit
07332a91c3
|
@ -9,7 +9,7 @@ import (
|
||||||
"github.com/markbates/pkger"
|
"github.com/markbates/pkger"
|
||||||
"github.com/markbates/pkger/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/parser"
|
"github.com/markbates/pkger/parser"
|
||||||
"github.com/markbates/pkger/pkging/mem"
|
"github.com/markbates/pkger/pkging/stuffing"
|
||||||
)
|
)
|
||||||
|
|
||||||
const outName = "pkged.go"
|
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(`")
|
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
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package mem
|
package mem_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
@ -8,6 +8,8 @@ import (
|
||||||
|
|
||||||
"github.com/markbates/pkger/here"
|
"github.com/markbates/pkger/here"
|
||||||
"github.com/markbates/pkger/parser"
|
"github.com/markbates/pkger/parser"
|
||||||
|
"github.com/markbates/pkger/pkging/mem"
|
||||||
|
"github.com/markbates/pkger/pkging/stuffing"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -41,10 +43,10 @@ func Test_Pkger_Embedding(t *testing.T) {
|
||||||
|
|
||||||
bb := &bytes.Buffer{}
|
bb := &bytes.Buffer{}
|
||||||
|
|
||||||
err = Stuff(bb, info, paths)
|
err = stuffing.Stuff(bb, info, paths)
|
||||||
r.NoError(err)
|
r.NoError(err)
|
||||||
|
|
||||||
pkg, err := UnmarshalEmbed(bb.Bytes())
|
pkg, err := mem.UnmarshalEmbed(bb.Bytes())
|
||||||
r.NoError(err)
|
r.NoError(err)
|
||||||
|
|
||||||
var res []string
|
var res []string
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
package mem
|
package stuffing
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io"
|
"io"
|
||||||
|
|
||||||
"github.com/markbates/pkger/here"
|
"github.com/markbates/pkger/here"
|
||||||
|
"github.com/markbates/pkger/pkging/mem"
|
||||||
"github.com/markbates/pkger/pkging/stdos"
|
"github.com/markbates/pkger/pkging/stdos"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -13,7 +14,7 @@ func Stuff(w io.Writer, cur here.Info, paths []here.Path) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg, err := New(cur)
|
pkg, err := mem.New(cur)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
Loading…
Reference in New Issue