uri_unix.go 222 B

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