From dff78d82ce21d97cad53171b72b88550e02c2c7f Mon Sep 17 00:00:00 2001 From: Mohammed Al Sahaf Date: Fri, 3 Jan 2020 21:33:22 +0300 Subject: v2: housekeeping: address minor lint complaints (#2957) * v2: housekeeping: update tools * v2: housekeeping: adhere to US locale in spelling * v2: housekeeping: simplify code --- modules/caddyhttp/starlarkmw/internal/lib/module.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/caddyhttp/starlarkmw') diff --git a/modules/caddyhttp/starlarkmw/internal/lib/module.go b/modules/caddyhttp/starlarkmw/internal/lib/module.go index a75aedf..13c706c 100644 --- a/modules/caddyhttp/starlarkmw/internal/lib/module.go +++ b/modules/caddyhttp/starlarkmw/internal/lib/module.go @@ -60,7 +60,7 @@ func (r *LoadMiddleware) Run(thread *starlark.Thread, fn *starlark.Builtin, args js := json.RawMessage(cfg.String()) - if strings.Index(name, "http.handlers.") == -1 { + if !strings.Contains(name, "http.handlers.") { name = fmt.Sprintf("http.handlers.%s", name) } @@ -108,7 +108,7 @@ func (r *LoadResponder) Run(thread *starlark.Thread, fn *starlark.Builtin, args js := json.RawMessage(cfg.String()) - if strings.Index(name, "http.handlers.") == -1 { + if !strings.Contains(name, "http.handlers.") { name = fmt.Sprintf("http.handlers.%s", name) } -- cgit v1.2.3