Update dependencies

This commit is contained in:
Alexander Neumann
2019-04-24 12:32:52 +02:00
parent c7762453cf
commit ca8c3b4fd5
286 changed files with 28160 additions and 15888 deletions
+3
View File
@@ -9,6 +9,9 @@ GOOS=darwin go build
echo "Building for FreeBSD..."
GOOS=freebsd go build
echo "Building for Windows...(dummy)"
GOOS=windows go build
echo "Running tests..."
go vet
go test -v -race -coverprofile=coverage.txt -covermode=atomic
+4 -2
View File
@@ -2,11 +2,12 @@ language: go
sudo: false
go:
- "1.11"
- "1.11.x"
os:
- linux
- osx
- windows
before_install:
- go version
@@ -18,7 +19,8 @@ install:
script:
- ./.travis.sh
- diff <(goimports -d .) <(printf "")
# goimports on windows gives false positives
- if [[ "${TRAVIS_OS_NAME}" != "windows" ]]; then diff <(goimports -d .) <(printf ""); fi
after_success:
- bash <(curl -s https://codecov.io/bash)
+2 -2
View File
@@ -6,11 +6,11 @@
xattr
=====
Extended attribute support for Go (linux + darwin + freebsd).
Extended attribute support for Go (linux + darwin + freebsd + netbsd).
"Extended attributes are name:value pairs associated permanently with files and directories, similar to the environment strings associated with a process. An attribute may be defined or undefined. If it is defined, its value may be empty or non-empty." [See more...](https://en.wikipedia.org/wiki/Extended_file_attributes)
`SetWithFlags` allows to additionally pass system flags to be forwarded to the underlying calls, FreeBSD does not support this and the parameter will be ignored.
`SetWithFlags` allows to additionally pass system flags to be forwarded to the underlying calls. FreeBSD and NetBSD do not support this and the parameter will be ignored.
The `L` variants of all functions (`LGet/LSet/...`) are identical to `Get/Set/...` except that they
do not reference a symlink that appears at the end of a path. See
@@ -1,4 +1,4 @@
// +build freebsd
// +build freebsd netbsd
package xattr
+4 -47
View File
@@ -5,7 +5,6 @@ package xattr
import (
"os"
"syscall"
"unsafe"
"golang.org/x/sys/unix"
)
@@ -30,23 +29,7 @@ func getxattr(path string, name string, data []byte) (int, error) {
}
func lgetxattr(path string, name string, data []byte) (int, error) {
value, size := bytePtrFromSlice(data)
/*
ssize_t getxattr(
const char *path,
const char *name,
void *value,
size_t size,
u_int32_t position,
int options
)
*/
r0, _, err := syscall.Syscall6(syscall.SYS_GETXATTR, uintptr(unsafe.Pointer(syscall.StringBytePtr(path))),
uintptr(unsafe.Pointer(syscall.StringBytePtr(name))), uintptr(unsafe.Pointer(value)), uintptr(size), 0, XATTR_NOFOLLOW)
if err != syscall.Errno(0) {
return int(r0), err
}
return int(r0), nil
return unix.Lgetxattr(path, name, data)
}
func fgetxattr(f *os.File, name string, data []byte) (int, error) {
@@ -58,7 +41,7 @@ func setxattr(path string, name string, data []byte, flags int) error {
}
func lsetxattr(path string, name string, data []byte, flags int) error {
return unix.Setxattr(path, name, data, flags|XATTR_NOFOLLOW)
return unix.Lsetxattr(path, name, data, flags)
}
func fsetxattr(f *os.File, name string, data []byte, flags int) error {
@@ -70,19 +53,7 @@ func removexattr(path string, name string) error {
}
func lremovexattr(path string, name string) error {
/*
int removexattr(
const char *path,
const char *name,
int options
);
*/
_, _, err := syscall.Syscall(syscall.SYS_REMOVEXATTR, uintptr(unsafe.Pointer(syscall.StringBytePtr(path))),
uintptr(unsafe.Pointer(syscall.StringBytePtr(name))), XATTR_NOFOLLOW)
if err != syscall.Errno(0) {
return err
}
return nil
return unix.Lremovexattr(path, name)
}
func fremovexattr(f *os.File, name string) error {
@@ -94,21 +65,7 @@ func listxattr(path string, data []byte) (int, error) {
}
func llistxattr(path string, data []byte) (int, error) {
name, size := bytePtrFromSlice(data)
/*
ssize_t listxattr(
const char *path,
char *name,
size_t size,
int options
);
*/
r0, _, err := syscall.Syscall6(syscall.SYS_LISTXATTR, uintptr(unsafe.Pointer(syscall.StringBytePtr(path))),
uintptr(unsafe.Pointer(name)), uintptr(size), XATTR_NOFOLLOW, 0, 0)
if err != syscall.Errno(0) {
return int(r0), err
}
return int(r0), nil
return unix.Llistxattr(path, data)
}
func flistxattr(f *os.File, data []byte) (int, error) {
+60
View File
@@ -0,0 +1,60 @@
// +build !linux,!freebsd,!netbsd,!darwin
package xattr
import (
"os"
)
func getxattr(path string, name string, data []byte) (int, error) {
return 0, nil
}
func lgetxattr(path string, name string, data []byte) (int, error) {
return 0, nil
}
func fgetxattr(f *os.File, name string, data []byte) (int, error) {
return 0, nil
}
func setxattr(path string, name string, data []byte, flags int) error {
return nil
}
func lsetxattr(path string, name string, data []byte, flags int) error {
return nil
}
func fsetxattr(f *os.File, name string, data []byte, flags int) error {
return nil
}
func removexattr(path string, name string) error {
return nil
}
func lremovexattr(path string, name string) error {
return nil
}
func fremovexattr(f *os.File, name string) error {
return nil
}
func listxattr(path string, data []byte) (int, error) {
return 0, nil
}
func llistxattr(path string, data []byte) (int, error) {
return 0, nil
}
func flistxattr(f *os.File, data []byte) (int, error) {
return 0, nil
}
// dummy
func stringsFromByteSlice(buf []byte) (result []string) {
return []string{}
}