updatefunc: simplify the function signature
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
0b5038d0bc
commit
9408f0f4c0
4 changed files with 17 additions and 17 deletions
|
@ -9,12 +9,12 @@ import (
|
|||
"github.com/vbatts/go-mtree/xattr"
|
||||
)
|
||||
|
||||
func xattrUpdateKeywordFunc(keyword Keyword, path, value string) (os.FileInfo, error) {
|
||||
buf, err := base64.StdEncoding.DecodeString(value)
|
||||
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, keyword.Suffix(), buf); err != nil {
|
||||
if err := xattr.Set(path, kv.Keyword().Suffix(), buf); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return os.Lstat(path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue