1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-31 08:12:22 +08:00
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
Jeromy
2015-09-02 10:57:26 -07:00
parent 167532c2b6
commit 56f01e4981
2 changed files with 8 additions and 6 deletions

View File

@ -77,7 +77,7 @@ func WrapData(b []byte) []byte {
return out
}
func SymlinkData(path string) []byte {
func SymlinkData(path string) ([]byte, error) {
pbdata := new(pb.Data)
typ := pb.Data_Symlink
pbdata.Data = []byte(path)
@ -85,10 +85,10 @@ func SymlinkData(path string) []byte {
out, err := proto.Marshal(pbdata)
if err != nil {
panic(err)
return nil, err
}
return out
return out, nil
}
func UnwrapData(data []byte) ([]byte, error) {