Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
6546aead
Unverified
提交
6546aead
authored
3月 24, 2017
作者:
Jakub Sztandera
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: multiple govet warnings
License: MIT Signed-off-by:
Jakub Sztandera
<
kubuxu@protonmail.ch
>
上级
1d59331b
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
30 行增加
和
20 行删除
+30
-20
blockstore.go
blocks/blockstore/blockstore.go
+2
-2
bloom_cache_test.go
blocks/blockstore/bloom_cache_test.go
+6
-2
blockservice_test.go
blockservice/blockservice_test.go
+1
-1
main.go
cmd/ipfswatch/main.go
+5
-3
handler.go
commands/http/handler.go
+3
-4
unixfs_test.go
core/coreapi/unixfs_test.go
+2
-2
filestore.go
filestore/filestore.go
+1
-0
ipns_unix.go
fuse/ipns/ipns_unix.go
+0
-2
path_test.go
path/path_test.go
+1
-1
pin_test.go
pin/pin_test.go
+5
-2
set_test.go
pin/set_test.go
+1
-1
dagmodifier.go
unixfs/mod/dagmodifier.go
+3
-0
没有找到文件。
blocks/blockstore/blockstore.go
浏览文件 @
6546aead
...
...
@@ -198,14 +198,14 @@ func (bs *blockstore) AllKeysChan(ctx context.Context) (<-chan *cid.Cid, error)
return
}
if
e
.
Error
!=
nil
{
log
.
Errorf
(
"blockstore.AllKeysChan got err:"
,
e
.
Error
)
log
.
Errorf
(
"blockstore.AllKeysChan got err:
%s
"
,
e
.
Error
)
return
}
// need to convert to key.Key using key.KeyFromDsKey.
k
,
err
:=
dshelp
.
DsKeyToCid
(
ds
.
RawKey
(
e
.
Key
))
if
err
!=
nil
{
log
.
Warningf
(
"error parsing key from DsKey: "
,
err
)
log
.
Warningf
(
"error parsing key from DsKey:
%s
"
,
err
)
continue
}
...
...
blocks/blockstore/bloom_cache_test.go
浏览文件 @
6546aead
...
...
@@ -31,7 +31,9 @@ func testBloomCached(bs Blockstore, ctx context.Context) (*bloomcache, error) {
func
TestPutManyAddsToBloom
(
t
*
testing
.
T
)
{
bs
:=
NewBlockstore
(
syncds
.
MutexWrap
(
ds
.
NewMapDatastore
()))
ctx
,
_
:=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
defer
cancel
()
cachedbs
,
err
:=
testBloomCached
(
bs
,
ctx
)
select
{
...
...
@@ -75,7 +77,9 @@ func TestHasIsBloomCached(t *testing.T) {
for
i
:=
0
;
i
<
1000
;
i
++
{
bs
.
Put
(
blocks
.
NewBlock
([]
byte
(
fmt
.
Sprintf
(
"data: %d"
,
i
))))
}
ctx
,
_
:=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
1
*
time
.
Second
)
defer
cancel
()
cachedbs
,
err
:=
testBloomCached
(
bs
,
ctx
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
...
...
blockservice/blockservice_test.go
浏览文件 @
6546aead
...
...
@@ -32,7 +32,7 @@ func TestWriteThroughWorks(t *testing.T) {
bserv
.
AddBlock
(
block
)
if
bstore
.
PutCounter
!=
2
{
t
.
Fatal
(
"Put should have called again, should be 2 is: %d"
,
bstore
.
PutCounter
)
t
.
Fatal
f
(
"Put should have called again, should be 2 is: %d"
,
bstore
.
PutCounter
)
}
}
...
...
cmd/ipfswatch/main.go
浏览文件 @
6546aead
package
main
import
(
"context"
"flag"
"log"
"os"
"os/signal"
"path/filepath"
context
"context"
homedir
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/mitchellh/go-homedir"
commands
"github.com/ipfs/go-ipfs/commands"
core
"github.com/ipfs/go-ipfs/core"
corehttp
"github.com/ipfs/go-ipfs/core/corehttp"
coreunix
"github.com/ipfs/go-ipfs/core/coreunix"
config
"github.com/ipfs/go-ipfs/repo/config"
fsrepo
"github.com/ipfs/go-ipfs/repo/fsrepo"
homedir
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/mitchellh/go-homedir"
process
"gx/ipfs/QmSF8fPo3jgVBAy8fpdjjYqgG87dkJgUprRBHRd2tmfgpP/goprocess"
fsnotify
"gx/ipfs/QmczzCMvJ3HV57WBKDy8b4ucp7quT325JjDbixYRS5Pwvv/fsnotify.v1"
)
...
...
@@ -141,7 +144,6 @@ func run(ipfsPath, watchPath string) error {
log
.
Println
(
err
)
}
}
return
nil
}
func
addTree
(
w
*
fsnotify
.
Watcher
,
root
string
)
error
{
...
...
commands/http/handler.go
浏览文件 @
6546aead
package
http
import
(
"context"
"errors"
"fmt"
"io"
...
...
@@ -11,11 +12,10 @@ import (
"strings"
"sync"
c
ontext
"context
"
c
mds
"github.com/ipfs/go-ipfs/commands
"
"github.com/ipfs/go-ipfs/repo/config"
cors
"gx/ipfs/QmPG2kW5t27LuHgHnvhUwbHCNHAt2eUcb4gPHqofrESUdB/cors"
c
mds
"github.com/ipfs/go-ipfs/command
s"
c
ors
"gx/ipfs/QmPG2kW5t27LuHgHnvhUwbHCNHAt2eUcb4gPHqofrESUdB/cor
s"
logging
"gx/ipfs/QmSpJByNKFX1sCsHBEp3R73FL4NF6FnQTEGyNAXHm2GS52/go-log"
)
...
...
@@ -323,7 +323,6 @@ func flushCopy(w io.Writer, r io.Reader) error {
f
.
Flush
()
}
return
nil
}
func
sanitizedErrStr
(
err
error
)
string
{
...
...
core/coreapi/unixfs_test.go
浏览文件 @
6546aead
...
...
@@ -205,7 +205,7 @@ func TestCatOffline(t *testing.T) {
_
,
err
=
api
.
Cat
(
ctx
,
coreapi
.
ResolvedPath
(
"/ipns/Qmfoobar"
,
nil
,
nil
))
if
err
!=
coreiface
.
ErrOffline
{
t
.
Fatalf
(
"expected ErrOffline, got: %"
,
err
)
t
.
Fatalf
(
"expected ErrOffline, got: %
s
"
,
err
)
}
}
...
...
@@ -223,7 +223,7 @@ func TestLs(t *testing.T) {
}
parts
:=
strings
.
Split
(
k
,
"/"
)
if
len
(
parts
)
!=
2
{
t
.
Errorf
(
"unexpected path:"
,
k
)
t
.
Errorf
(
"unexpected path:
%s
"
,
k
)
}
p
:=
coreapi
.
ResolvedPath
(
"/ipfs/"
+
parts
[
0
],
nil
,
nil
)
...
...
filestore/filestore.go
浏览文件 @
6546aead
...
...
@@ -36,6 +36,7 @@ func (f *Filestore) AllKeysChan(ctx context.Context) (<-chan *cid.Cid, error) {
a
,
err
:=
f
.
bs
.
AllKeysChan
(
ctx
)
if
err
!=
nil
{
cancel
()
return
nil
,
err
}
...
...
fuse/ipns/ipns_unix.go
浏览文件 @
6546aead
...
...
@@ -126,8 +126,6 @@ func loadRoot(ctx context.Context, rt *keyRoot, ipfs *core.IpfsNode, name string
default
:
return
nil
,
errors
.
New
(
"unrecognized type"
)
}
panic
(
"not reached"
)
}
type
keyRoot
struct
{
...
...
path/path_test.go
浏览文件 @
6546aead
...
...
@@ -24,7 +24,7 @@ func TestPathParsing(t *testing.T) {
_
,
err
:=
ParsePath
(
p
)
valid
:=
(
err
==
nil
)
if
valid
!=
expected
{
t
.
Fatalf
(
"expected %s to have valid == %
s
"
,
p
,
expected
)
t
.
Fatalf
(
"expected %s to have valid == %
t
"
,
p
,
expected
)
}
}
}
...
...
pin/pin_test.go
浏览文件 @
6546aead
...
...
@@ -341,7 +341,9 @@ func TestPinRecursiveFail(t *testing.T) {
}
// NOTE: This isnt a time based test, we expect the pin to fail
mctx
,
_
:=
context
.
WithTimeout
(
ctx
,
time
.
Millisecond
)
mctx
,
cancel
:=
context
.
WithTimeout
(
ctx
,
time
.
Millisecond
)
defer
cancel
()
err
=
p
.
Pin
(
mctx
,
a
,
true
)
if
err
==
nil
{
t
.
Fatal
(
"should have failed to pin here"
)
...
...
@@ -358,7 +360,8 @@ func TestPinRecursiveFail(t *testing.T) {
}
// this one is time based... but shouldnt cause any issues
mctx
,
_
=
context
.
WithTimeout
(
ctx
,
time
.
Second
)
mctx
,
cancel
=
context
.
WithTimeout
(
ctx
,
time
.
Second
)
defer
cancel
()
err
=
p
.
Pin
(
mctx
,
a
,
true
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
...
...
pin/set_test.go
浏览文件 @
6546aead
...
...
@@ -95,7 +95,7 @@ func TestSet(t *testing.T) {
for
_
,
c
:=
range
inputs
{
if
!
seen
.
Has
(
c
)
{
t
.
Fatalf
(
"expected to have
%s, didnt find it"
)
t
.
Fatalf
(
"expected to have
'%s', didnt find it"
,
c
)
}
}
}
unixfs/mod/dagmodifier.go
浏览文件 @
6546aead
...
...
@@ -336,15 +336,18 @@ func (dm *DagModifier) readPrep() error {
ctx
,
cancel
:=
context
.
WithCancel
(
dm
.
ctx
)
dr
,
err
:=
uio
.
NewDagReader
(
ctx
,
dm
.
curNode
,
dm
.
dagserv
)
if
err
!=
nil
{
cancel
()
return
err
}
i
,
err
:=
dr
.
Seek
(
int64
(
dm
.
curWrOff
),
os
.
SEEK_SET
)
if
err
!=
nil
{
cancel
()
return
err
}
if
i
!=
int64
(
dm
.
curWrOff
)
{
cancel
()
return
ErrSeekFail
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论