Skip to content

Commit

Permalink
优化生成模板
Browse files Browse the repository at this point in the history
  • Loading branch information
Luoxin committed Jun 11, 2024
1 parent 98d277e commit 8d16d17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion codegen/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ var DefaultTemplateFunc = template.FuncMap{
"PluckInt64": anyx.PluckInt64,
"PluckUint64": anyx.PluckUint64,

"SliceEmpty": func(ss []string) bool {
"StringSliceEmpty": func(ss []string) bool {
return len(ss) == 0
},

Expand Down
4 changes: 2 additions & 2 deletions codegen/template/rpc_route.gtpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package main

import (
import ({{ if gt (len .RPCS) 0 }}
"github.com/lazygophers/{{ $.PB.GoPackageName }}"
"github.com/lazygophers/{{ $.PB.GoPackageName }}/internal/impl"
"github.com/lazygophers/{{ $.PB.GoPackageName }}/internal/impl" {{ end }}
"github.com/lazygophers/lrpc"
)

Expand Down

0 comments on commit 8d16d17

Please sign in to comment.