uri_unix.go 203 B

123456789101112
  1. //go:build !windows
  2. package fasthttp
  3. func addLeadingSlash(dst, src []byte) []byte {
  4. // add leading slash for unix paths
  5. if len(src) == 0 || src[0] != '/' {
  6. dst = append(dst, '/')
  7. }
  8. return dst
  9. }