Skip to content

Commit

Permalink
fix: use correct package name
Browse files Browse the repository at this point in the history
  • Loading branch information
crhntr committed Oct 29, 2024
1 parent 5d96a33 commit 61d8c3f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/muxt/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
30 changes: 30 additions & 0 deletions cmd/muxt/testdata/generate/package.txtar
Original file line number Diff line number Diff line change
@@ -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 --
<h1>hello</h1>

0 comments on commit 61d8c3f

Please sign in to comment.