aboutsummaryrefslogtreecommitdiff
path: root/ciigo.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-10-27 22:01:43 +0700
committerShulhan <ms@kilabit.info>2021-10-27 22:01:43 +0700
commit0bfe10781a53474fba2ab2b3f933df6b7e0a4e70 (patch)
treef929439ebaa4c1b58bac05925f21e693a20ab8e6 /ciigo.go
parent36d729c71dd03303a2eef4cfefa64ac1a78a0ec1 (diff)
downloadciigo-0bfe10781a53474fba2ab2b3f933df6b7e0a4e70.tar.xz
all: update to latest share module
The latest share module simplify the memfs.GoEmbed call by using struct memfs.EmbedOptions instead of passing it as parameters. The changes on share module affect on how EmbedOptions in this module, where memfs.EmbedOptions is used to replace field PackageName, VarName, and GoFileName.
Diffstat (limited to 'ciigo.go')
-rw-r--r--ciigo.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/ciigo.go b/ciigo.go
index d25d1c7..14c2202 100644
--- a/ciigo.go
+++ b/ciigo.go
@@ -117,7 +117,10 @@ func GoEmbed(opts *EmbedOptions) (err error) {
memfsOpts := &memfs.Options{
Root: opts.Root,
Excludes: defExcludes,
+ Embed: opts.EmbedOptions,
}
+ memfsOpts.Embed.ContentEncoding = memfs.EncodingGzip
+
mfs, err = memfs.New(memfsOpts)
if err != nil {
return fmt.Errorf("%s: %w", logp, err)
@@ -130,7 +133,7 @@ func GoEmbed(opts *EmbedOptions) (err error) {
}
}
- err = mfs.GoEmbed(opts.PackageName, opts.VarName, opts.GoFileName, memfs.EncodingGzip)
+ err = mfs.GoEmbed()
if err != nil {
return fmt.Errorf("%s: %w", logp, err)
}