// Copyright 2020 The Gogs Authors. All rights reserved.// Use of this source code is governed by a MIT-style// license that can be found in the LICENSE file.packagepathutilimport("path""strings")// Clean cleans up given path and returns a relative path that goes straight// down to prevent path traversal.funcClean(pstring)string{p=strings.ReplaceAll(p,`\`,"/")returnstrings.Trim(path.Clean("/"+p),"/")}