From 997514292a8492d2291643e91081f3e790eefbaf Mon Sep 17 00:00:00 2001 From: tjpcc Date: Tue, 24 Jan 2023 19:59:47 -0700 Subject: testing and linting and linter fixes --- contrib/cgi/cgi.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'contrib/cgi') diff --git a/contrib/cgi/cgi.go b/contrib/cgi/cgi.go index ab10622..71743a0 100644 --- a/contrib/cgi/cgi.go +++ b/contrib/cgi/cgi.go @@ -116,9 +116,7 @@ func RunCGI( } scriptName := req.Path[:len(req.Path)-infoLen] - if strings.HasSuffix(scriptName, "/") { - scriptName = scriptName[:len(scriptName)-1] - } + scriptName = strings.TrimSuffix(scriptName, "/") cmd := exec.CommandContext(ctx, "./"+basename) cmd.Env = prepareCGIEnv(ctx, req, scriptName, pathInfo) -- cgit v1.2.3