From de2d4eacdad11e9df6cae3e5d2496cd60389d16c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=85=E5=AD=90?= <906604588@qq.com> Date: Fri, 18 Mar 2022 11:33:14 +0800 Subject: [PATCH] fix(cmd): proto-gen-go-http warn only when ending with a slash (#1887) --- cmd/protoc-gen-go-http/http.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmd/protoc-gen-go-http/http.go b/cmd/protoc-gen-go-http/http.go index 5a363af31..a697968b3 100644 --- a/cmd/protoc-gen-go-http/http.go +++ b/cmd/protoc-gen-go-http/http.go @@ -204,8 +204,7 @@ func buildMethodDesc(g *protogen.GeneratedFile, m *protogen.Method, method, path func buildPathVars(path string) (res map[string]*string) { if strings.HasSuffix(path, "/") { - fmt.Fprintf(os.Stderr, "\u001B[31mERROR\u001B[m: Path %s should not end with \"/\" \n", path) - os.Exit(2) + fmt.Fprintf(os.Stderr, "\u001B[31mWARN\u001B[m: Path %s should not end with \"/\" \n", path) } res = make(map[string]*string) pattern := regexp.MustCompile(`(?i){([a-z\.0-9_\s]*)=?([^{}]*)}`)