mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-31 08:12:22 +08:00
rm panic
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
@ -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) {
|
||||
|
Reference in New Issue
Block a user