File: posix.go

package info (click to toggle)
golang-github-twpayne-go-vfs 4.1.0-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 212 kB
  • sloc: makefile: 30
file content (28 lines) | stat: -rw-r--r-- 581 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//go:build !windows
// +build !windows

package vfs

import (
	"strings"
	"syscall"
)

//nolint:gochecknoglobals
var ignoreErrnoInContains = map[syscall.Errno]struct{}{
	syscall.ELOOP:        {},
	syscall.EMLINK:       {},
	syscall.ENAMETOOLONG: {},
	syscall.ENOENT:       {},
	syscall.EOVERFLOW:    {},
}

// relativizePath, on POSIX systems, just returns path.
func relativizePath(path string) string {
	return path
}

// trimPrefix, on POSIX systems, trims prefix from path.
func trimPrefix(path, prefix string) (string, error) {
	return strings.TrimPrefix(path, prefix), nil
}