mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-26 21:07:45 +08:00
add type assertion checked
License: MIT Signed-off-by: Kejie Zhang <601172892@qq.com>
This commit is contained in:
parent
9898ba9309
commit
7de83f25b2
@ -472,10 +472,12 @@ func (adder *Adder) addFile(file files.File) error {
|
||||
}
|
||||
|
||||
addFileName := file.FileName()
|
||||
addFileInfo := file.(files.FileInfo)
|
||||
if addFileInfo.AbsPath() == os.Stdin.Name() && adder.Name != "" {
|
||||
addFileName = adder.Name
|
||||
adder.Name = ""
|
||||
addFileInfo, ok := file.(files.FileInfo)
|
||||
if ok {
|
||||
if addFileInfo.AbsPath() == os.Stdin.Name() && adder.Name != "" {
|
||||
addFileName = adder.Name
|
||||
adder.Name = ""
|
||||
}
|
||||
}
|
||||
// patch it into the root
|
||||
return adder.addNode(dagnode, addFileName)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user