From 10bfc22c8ddcece0b30bee14d2e0ff906f4dddaa Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Wed, 26 Jul 2023 11:32:32 +0800 Subject: [PATCH] chore: use strings.Contains instead --- internal/openapi/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/openapi/server.go b/internal/openapi/server.go index a20b7897..905ed610 100644 --- a/internal/openapi/server.go +++ b/internal/openapi/server.go @@ -52,7 +52,7 @@ func (srv *Server) sanitize() *core.Error { } k := "{" + key + "}" - if strings.Index(srv.URL, k) < 0 { + if !strings.Contains(srv.URL, k) { return core.NewError(locale.ErrInvalidValue).WithField("variables[" + key + "]") } }