Skip to content

Commit 9283be8

Browse files
committed
doc: update doc for gin router
1 parent 1e9ae46 commit 9283be8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

router/gin/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ import (
2727
"github.com/zeromicro/go-zero/core/service"
2828
"github.com/zeromicro/go-zero/rest"
2929
"github.com/zeromicro/go-zero/rest/httpx"
30-
"github.com/zeromicro/zero-contrib/router/gin"
31-
stdgin "github.com/gin-gonic/gin"
30+
zerogin "github.com/zeromicro/zero-contrib/router/gin"
31+
"github.com/gin-gonic/gin"
3232
)
3333

3434
type CommonPathID struct {
@@ -46,11 +46,12 @@ func (c *CommonPathID) String() string {
4646
}
4747

4848
func init() {
49-
stdgin.SetMode(stdgin.ReleaseMode)
49+
gin.SetMode(gin.ReleaseMode)
5050
}
5151

5252
func main() {
53-
r := gin.NewRouter()
53+
server := gin.New()
54+
r := zerogin.NewRouter(r)
5455
engine := rest.MustNewServer(rest.RestConf{
5556
ServiceConf: service.ServiceConf{
5657
Log: logx.LogConf{

0 commit comments

Comments
 (0)