Skip to content

Commit

Permalink
Fix potential newlines in version file breaking code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperManifolds committed Apr 4, 2024
1 parent 49e5f5f commit 43d41f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/generator/generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package generator

import (
"bytes"
"strings"
"text/template"

generator "github.com/loopholelabs/polyglot/generator/golang"
Expand Down Expand Up @@ -121,7 +122,7 @@ func (g *Generator) Generate(req *pluginpb.CodeGeneratorRequest) (res *pluginpb.
numStreamMethods, numMethods := extractNumberOfMethods(f)

err = templ.ExecuteTemplate(genFile, "prebase.templ", map[string]interface{}{
"pluginVersion": version.Version,
"pluginVersion": strings.TrimSpace(version.Version),
"sourcePath": f.Desc.Path(),
"package": packageName,
"requiredImports": requiredImports,
Expand Down
2 changes: 1 addition & 1 deletion pkg/generator/test/test.frpc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 43d41f9

Please sign in to comment.