1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2024-11-22 08:25:38 +00:00
go-mtree/updatefuncs_linux.go
Vincent Batts 94303e15af
*.go: updated go:build added via gofmt
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2022-04-23 12:59:26 -04:00

22 lines
408 B
Go

//go:build linux
// +build linux
package mtree
import (
"encoding/base64"
"os"
"github.com/vbatts/go-mtree/xattr"
)
func xattrUpdateKeywordFunc(path string, kv KeyVal) (os.FileInfo, error) {
buf, err := base64.StdEncoding.DecodeString(kv.Value())
if err != nil {
return nil, err
}
if err := xattr.Set(path, kv.Keyword().Suffix(), buf); err != nil {
return nil, err
}
return os.Lstat(path)
}