Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
45756b6d
提交
45756b6d
authored
2月 20, 2018
作者:
Steven Allen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix a bunch of go vet errors
License: MIT Signed-off-by:
Steven Allen
<
steven@stebalien.com
>
上级
868855f6
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
26 行增加
和
12 行删除
+26
-12
request.go
commands/legacy/request.go
+11
-3
response.go
commands/legacy/response.go
+1
-1
request.go
commands/request.go
+10
-2
get.go
core/commands/get.go
+1
-1
block.go
core/coreapi/block.go
+0
-2
object_test.go
core/coreapi/object_test.go
+1
-1
unixfs.go
core/coreapi/unixfs.go
+1
-1
metrics_test.go
core/corehttp/metrics_test.go
+1
-1
没有找到文件。
commands/legacy/request.go
浏览文件 @
45756b6d
...
...
@@ -77,7 +77,7 @@ func (r *requestWrapper) Option(name string) *cmdkit.OptionValue {
optDefs
,
err
:=
r
.
req
.
Root
.
GetOptions
(
r
.
req
.
Path
)
if
err
!=
nil
{
return
&
cmdkit
.
OptionValue
{
nil
,
false
,
nil
}
return
&
cmdkit
.
OptionValue
{}
}
for
_
,
def
:=
range
optDefs
{
for
_
,
optName
:=
range
def
.
Names
()
{
...
...
@@ -95,11 +95,19 @@ func (r *requestWrapper) Option(name string) *cmdkit.OptionValue {
for
_
,
n
:=
range
option
.
Names
()
{
val
,
found
:=
r
.
req
.
Options
[
n
]
if
found
{
return
&
cmdkit
.
OptionValue
{
val
,
found
,
option
}
return
&
cmdkit
.
OptionValue
{
Value
:
val
,
ValueFound
:
found
,
Def
:
option
,
}
}
}
return
&
cmdkit
.
OptionValue
{
option
.
Default
(),
false
,
option
}
return
&
cmdkit
.
OptionValue
{
Value
:
option
.
Default
(),
ValueFound
:
false
,
Def
:
option
,
}
}
func
(
r
*
requestWrapper
)
Options
()
cmdkit
.
OptMap
{
...
...
commands/legacy/response.go
浏览文件 @
45756b6d
...
...
@@ -155,7 +155,7 @@ func (r *fakeResponse) SetOutput(v interface{}) {
_
,
isReader
:=
v
.
(
io
.
Reader
)
if
t
!=
nil
&&
t
.
Kind
()
!=
reflect
.
Chan
&&
!
isReader
{
v
=
cmds
.
Single
{
v
}
v
=
cmds
.
Single
{
Value
:
v
}
}
r
.
out
=
v
...
...
commands/request.go
浏览文件 @
45756b6d
...
...
@@ -161,11 +161,19 @@ func (r *request) Option(name string) *cmdkit.OptionValue {
for
_
,
n
:=
range
option
.
Names
()
{
val
,
found
:=
r
.
options
[
n
]
if
found
{
return
&
cmdkit
.
OptionValue
{
val
,
found
,
option
}
return
&
cmdkit
.
OptionValue
{
Value
:
val
,
ValueFound
:
found
,
Def
:
option
,
}
}
}
return
&
cmdkit
.
OptionValue
{
option
.
Default
(),
false
,
option
}
return
&
cmdkit
.
OptionValue
{
Value
:
option
.
Default
(),
ValueFound
:
false
,
Def
:
option
,
}
}
// Options returns a copy of the option map
...
...
core/commands/get.go
浏览文件 @
45756b6d
...
...
@@ -247,7 +247,7 @@ func (gw *getWriter) writeExtracted(r io.Reader, fpath string) error {
defer
bar
.
Finish
()
defer
bar
.
Set64
(
gw
.
Size
)
extractor
:=
&
tar
.
Extractor
{
fpath
,
bar
.
Add64
}
extractor
:=
&
tar
.
Extractor
{
Path
:
fpath
,
Progress
:
bar
.
Add64
}
return
extractor
.
Extract
(
r
)
}
...
...
core/coreapi/block.go
浏览文件 @
45756b6d
...
...
@@ -111,8 +111,6 @@ func (api *BlockAPI) Rm(ctx context.Context, p coreiface.Path, opts ...caopts.Bl
case
<-
ctx
.
Done
()
:
return
ctx
.
Err
()
}
return
nil
}
func
(
api
*
BlockAPI
)
Stat
(
ctx
context
.
Context
,
p
coreiface
.
Path
)
(
coreiface
.
BlockStat
,
error
)
{
...
...
core/coreapi/object_test.go
浏览文件 @
45756b6d
...
...
@@ -268,7 +268,7 @@ func TestObjectAddLinkCreate(t *testing.T) {
t
.
Fatal
(
"expected an error"
)
}
if
err
.
Error
()
!=
"no link by that name"
{
t
.
Fatal
(
"unexpected error: %s"
,
err
.
Error
())
t
.
Fatal
f
(
"unexpected error: %s"
,
err
.
Error
())
}
p3
,
err
=
api
.
Object
()
.
AddLink
(
ctx
,
p2
,
"abc/d"
,
p2
,
api
.
Object
()
.
WithCreate
(
true
))
...
...
core/coreapi/unixfs.go
浏览文件 @
45756b6d
...
...
@@ -71,7 +71,7 @@ func (api *UnixfsAPI) Ls(ctx context.Context, p coreiface.Path) ([]*coreiface.Li
links
:=
make
([]
*
coreiface
.
Link
,
len
(
ndlinks
))
for
i
,
l
:=
range
ndlinks
{
links
[
i
]
=
&
coreiface
.
Link
{
l
.
Name
,
l
.
Size
,
l
.
Cid
}
links
[
i
]
=
&
coreiface
.
Link
{
Name
:
l
.
Name
,
Size
:
l
.
Size
,
Cid
:
l
.
Cid
}
}
return
links
,
nil
}
...
...
core/corehttp/metrics_test.go
浏览文件 @
45756b6d
...
...
@@ -45,6 +45,6 @@ func TestPeersTotal(t *testing.T) {
t
.
Fatalf
(
"expected 1 peers transport, got %d"
,
len
(
actual
))
}
if
actual
[
"/ip4/tcp"
]
!=
float64
(
3
)
{
t
.
Fatalf
(
"expected 3 peers, got %
s
"
,
actual
[
"/ip4/tcp"
])
t
.
Fatalf
(
"expected 3 peers, got %
f
"
,
actual
[
"/ip4/tcp"
])
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论