File: uri_unix.go

package info (click to toggle)
golang-github-valyala-fasthttp 1%3A1.31.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,504 kB
  • sloc: makefile: 27
file content (13 lines) | stat: -rw-r--r-- 222 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
//go:build !windows
// +build !windows

package fasthttp

func addLeadingSlash(dst, src []byte) []byte {
	// add leading slash for unix paths
	if len(src) == 0 || src[0] != '/' {
		dst = append(dst, '/')
	}

	return dst
}