diff --git a/cmd/muxt/generate.go b/cmd/muxt/generate.go index edfa099..5b4a996 100644 --- a/cmd/muxt/generate.go +++ b/cmd/muxt/generate.go @@ -96,7 +96,7 @@ func generateCommand(args []string, workingDirectory string, getEnv func(string) g.Package = packageList[i] } else if len(packageList) > 0 { g.Package = packageList[0] - g.goPackage = packageList[0].ID + g.goPackage = packageList[0].Name } ts, err := source.Templates(workingDirectory, g.templatesVariable, g.Package) if err != nil { diff --git a/cmd/muxt/testdata/generate/package.txtar b/cmd/muxt/testdata/generate/package.txtar new file mode 100644 index 0000000..1cef8c9 --- /dev/null +++ b/cmd/muxt/testdata/generate/package.txtar @@ -0,0 +1,30 @@ + +cd package +muxt generate + +exec go build + +-- package/go.mod -- +module pack + +go 1.18 + +-- package/main.go -- +package main + +import ( + "embed" + "html/template" +) + +var ( + //go:embed *.gohtml + templateFiles embed.FS + + templates = template.Must(template.ParseFS(templateFiles, "*")) +) + +func main() {} + +-- package/index.gohtml -- +