From 09ad76e01d774d8a3df353936617412c6bd081dc Mon Sep 17 00:00:00 2001 From: maddalax Date: Mon, 23 Sep 2024 16:54:31 -0500 Subject: [PATCH] hmm --- cli/htmgo/tasks/astgen/writer.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cli/htmgo/tasks/astgen/writer.go b/cli/htmgo/tasks/astgen/writer.go index 8557f3f..93f5697 100644 --- a/cli/htmgo/tasks/astgen/writer.go +++ b/cli/htmgo/tasks/astgen/writer.go @@ -7,6 +7,7 @@ import ( "go/parser" "go/token" "log" + "log/slog" "os" "path/filepath" ) @@ -16,6 +17,8 @@ func WriteFile(path string, cb func(content *ast.File) string) { path = filepath.Join(currentDir, path) + slog.Debug("astgen.WriteFile", slog.String("path", path)) + dir := filepath.Dir(path) os.MkdirAll(dir, 0755) @@ -49,7 +52,7 @@ func WriteFile(path string, cb func(content *ast.File) string) { bytes, err = format.Source(bytes) if err != nil { - log.Printf("Failed to format source: %v\n\n%s", err) + log.Printf("Failed to format source: %v\n", err.Error()) data := string(bytes) println(data) return