Skip to content

Commit

Permalink
fix: When repairing protobuf to generate controllers, if the project … (
Browse files Browse the repository at this point in the history
  • Loading branch information
liangguifeng authored May 11, 2023
1 parent b8aeb4f commit 43d439a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/gf/internal/cmd/genpb/genpb_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package genpb
import (
"context"
"fmt"
"strings"

"github.com/gogf/gf/cmd/gf/v2/internal/utility/utils"
"github.com/gogf/gf/v2/frame/g"
Expand Down Expand Up @@ -85,7 +86,7 @@ func (c CGenPb) parseControllers(filePath string) ([]generateCtrl, error) {
func(match []string) string {
ctrl := generateCtrl{
Name: match[1],
Package: gfile.Basename(gfile.Dir(gfile.Dir(filePath))),
Package: strings.ReplaceAll(gfile.Basename(gfile.Dir(gfile.Dir(filePath))), "-", "_"),
Version: gfile.Basename(gfile.Dir(filePath)),
Methods: make([]generateCtrlMethod, 0),
}
Expand Down

0 comments on commit 43d439a

Please sign in to comment.