Skip to content

Commit

Permalink
Merge pull request #1 from Pipello/fix-template-files
Browse files Browse the repository at this point in the history
fix: Use Template Files
  • Loading branch information
Pipello authored Mar 15, 2024
2 parents 93f4720 + 74873ed commit 7187072
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions definition/model_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (m *Model) AutoFillProtoIndex() {
}

func (m *Model) GenerateDBModel() error {
t := template.Must(template.ParseFiles("./pkg/definition/model.go.tpl"))
t := template.Must(template.ParseFiles("model.go.tpl"))
outFile, err := os.Create("./internal/models/" + strings.ToLower(m.Name) + ".go")
if err != nil {
return err
Expand All @@ -130,7 +130,7 @@ func (m *Model) GenerateDBModel() error {
}

func (m *Model) GenerateService() error {
t := template.Must(template.ParseFiles("./pkg/definition/service.go.tpl"))
t := template.Must(template.ParseFiles("service.go.tpl"))
outFile, err := os.Create("./internal/services/" + strings.ToLower(m.Name) + ".go")
if err != nil {
return err
Expand Down Expand Up @@ -171,7 +171,7 @@ func (m *ModelGenerator) readCustomBlocks() {
}

func (g *ModelGenerator) GenerateServiceProto() error {
t := template.Must(template.ParseFiles("./pkg/definition/service.proto.tpl"))
t := template.Must(template.ParseFiles("service.proto.tpl"))
outFile, err := os.Create("./api/iot_collector_service.proto")
if err != nil {
return err
Expand All @@ -181,7 +181,7 @@ func (g *ModelGenerator) GenerateServiceProto() error {
}

func (g *ModelGenerator) GenerateServer() error {
t := template.Must(template.ParseFiles("./pkg/definition/server.go.tpl"))
t := template.Must(template.ParseFiles("server.go.tpl"))
outFile, err := os.Create("./internal/server/server_generated.go")
if err != nil {
return err
Expand Down

0 comments on commit 7187072

Please sign in to comment.