Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
ec19d4c5
Unverified
提交
ec19d4c5
authored
5月 15, 2019
作者:
Steven Allen
提交者:
GitHub
5月 15, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6321 from ipfs/ci/golangci-lint
Add golangci-lint
上级
373a49f4
9beddcd1
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
32 行增加
和
18 行删除
+32
-18
config.yml
.circleci/config.yml
+9
-0
Rules.mk
Rules.mk
+1
-1
ulimit_test.go
cmd/ipfs/util/ulimit_test.go
+1
-1
builder.go
core/builder.go
+4
-1
block.go
core/commands/block.go
+3
-0
commands.go
core/corehttp/commands.go
+2
-4
add_test.go
core/coreunix/add_test.go
+1
-1
builder.go
core/node/builder.go
+0
-3
storage.go
core/node/storage.go
+1
-1
fsrefstore.go
filestore/fsrefstore.go
+1
-1
go.mod
go.mod
+2
-1
go.sum
go.sum
+0
-0
golang.mk
mk/golang.mk
+3
-4
Rules.mk
test/bin/Rules.mk
+3
-0
dependencies.go
test/dependencies/dependencies.go
+1
-0
没有找到文件。
.circleci/config.yml
浏览文件 @
ec19d4c5
...
...
@@ -51,6 +51,15 @@ jobs:
environment
:
TEST_NO_FUSE
:
1
-
*store_gomod
golint
:
<<
:
*defaults
steps
:
-
checkout
-
*make_out_dirs
-
*restore_gomod
-
run
:
|
make -O test_go_lint
-
*store_gomod
gotest
:
<<
:
*defaults
steps
:
...
...
Rules.mk
浏览文件 @
ec19d4c5
...
...
@@ -141,7 +141,7 @@ help:
@
echo
' test_go_test - Run all go tests'
@
echo
' test_go_expensive - Run all go tests and compile on all platforms'
@
echo
' test_go_race - Run go tests with the race detector enabled'
@
echo
' test_go_
megacheck - Run the `megacheck
` vetting tool'
@
echo
' test_go_
lint - Run the `golangci-lint
` vetting tool'
@
echo
' test_sharness_short - Run short sharness tests'
@
echo
' test_sharness_expensive - Run all sharness tests'
@
echo
' coverage - Collects coverage info from unit tests and sharness'
...
...
cmd/ipfs/util/ulimit_test.go
浏览文件 @
ec19d4c5
...
...
@@ -42,7 +42,7 @@ func TestManageInvalidNFds(t *testing.T) {
if
changed
,
new
,
err
:=
ManageFdLimit
();
err
==
nil
{
t
.
Errorf
(
"ManageFdLimit should return an error: changed %t, new: %d"
,
changed
,
new
)
}
else
if
err
!=
nil
{
}
else
{
flag
:=
strings
.
Contains
(
err
.
Error
(),
"failed to raise ulimit to IPFS_FD_MAX"
)
if
!
flag
{
...
...
core/builder.go
浏览文件 @
ec19d4c5
...
...
@@ -31,7 +31,10 @@ func NewNode(ctx context.Context, cfg *BuildCfg) (*IpfsNode, error) {
// Note that some services use contexts to signal shutting down, which is
// very suboptimal. This needs to be here until that's addressed somehow
<-
ctx
.
Done
()
app
.
Stop
(
context
.
Background
())
err
:=
app
.
Stop
(
context
.
Background
())
if
err
!=
nil
{
log
.
Error
(
"failure on stop: "
,
err
)
}
}()
n
.
IsOnline
=
cfg
.
Online
...
...
core/commands/block.go
浏览文件 @
ec19d4c5
...
...
@@ -224,6 +224,9 @@ It takes a list of base58 encoded multihashes to remove.
// TODO: use batching coreapi when done
for
_
,
b
:=
range
req
.
Arguments
{
rp
,
err
:=
api
.
ResolvePath
(
req
.
Context
,
path
.
New
(
b
))
if
err
!=
nil
{
return
err
}
err
=
api
.
Block
()
.
Rm
(
req
.
Context
,
rp
,
options
.
Block
.
Force
(
force
))
if
err
!=
nil
{
...
...
core/corehttp/commands.go
浏览文件 @
ec19d4c5
...
...
@@ -61,10 +61,8 @@ func addHeadersFromConfig(c *cmdsHttp.ServerConfig, nc *config.Config) {
if
acam
:=
nc
.
API
.
HTTPHeaders
[
cmdsHttp
.
ACAMethods
];
acam
!=
nil
{
c
.
SetAllowedMethods
(
acam
...
)
}
if
acac
:=
nc
.
API
.
HTTPHeaders
[
cmdsHttp
.
ACACredentials
];
acac
!=
nil
{
for
_
,
v
:=
range
acac
{
c
.
SetAllowCredentials
(
strings
.
ToLower
(
v
)
==
"true"
)
}
for
_
,
v
:=
range
nc
.
API
.
HTTPHeaders
[
cmdsHttp
.
ACACredentials
]
{
c
.
SetAllowCredentials
(
strings
.
ToLower
(
v
)
==
"true"
)
}
c
.
Headers
=
make
(
map
[
string
][]
string
,
len
(
nc
.
API
.
HTTPHeaders
)
+
1
)
...
...
core/coreunix/add_test.go
浏览文件 @
ec19d4c5
...
...
@@ -68,7 +68,7 @@ func TestAddMultipleGCLive(t *testing.T) {
go
func
()
{
defer
close
(
out
)
adder
.
AddAllAndPin
(
slf
)
_
,
_
=
adder
.
AddAllAndPin
(
slf
)
// Ignore errors for clarity - the real bug would be gc'ing files while adding them, not this resultant error
}()
...
...
core/node/builder.go
浏览文件 @
ec19d4c5
...
...
@@ -15,13 +15,10 @@ import (
ds
"github.com/ipfs/go-datastore"
dsync
"github.com/ipfs/go-datastore/sync"
cfg
"github.com/ipfs/go-ipfs-config"
logging
"github.com/ipfs/go-log"
ci
"github.com/libp2p/go-libp2p-crypto"
peer
"github.com/libp2p/go-libp2p-peer"
)
var
log
=
logging
.
Logger
(
"node"
)
type
BuildCfg
struct
{
// If online is set, the node will have networking enabled
Online
bool
...
...
core/node/storage.go
浏览文件 @
ec19d4c5
...
...
@@ -91,7 +91,7 @@ func GcBlockstoreCtor(bb BaseBlocks) (gclocker blockstore.GCLocker, gcbs blockst
// GcBlockstoreCtor wraps GcBlockstore and adds Filestore support
func
FilestoreBlockstoreCtor
(
repo
repo
.
Repo
,
bb
BaseBlocks
)
(
gclocker
blockstore
.
GCLocker
,
gcbs
blockstore
.
GCBlockstore
,
bs
blockstore
.
Blockstore
,
fstore
*
filestore
.
Filestore
)
{
gclocker
,
gcbs
,
bs
=
GcBlockstoreCtor
(
bb
)
gclocker
=
blockstore
.
NewGCLocker
(
)
// hash security
fstore
=
filestore
.
NewFilestore
(
bb
,
repo
.
FileManager
())
...
...
filestore/fsrefstore.go
浏览文件 @
ec19d4c5
...
...
@@ -281,7 +281,7 @@ func (f *FileManager) putTo(b *posinfo.FilestoreNode, to putter) error {
if
!
f
.
AllowFiles
{
return
ErrFilestoreNotEnabled
}
if
!
filepath
.
HasPrefix
(
b
.
PosInfo
.
FullPath
,
f
.
root
)
{
if
!
filepath
.
HasPrefix
(
b
.
PosInfo
.
FullPath
,
f
.
root
)
{
//nolint:staticcheck
return
fmt
.
Errorf
(
"cannot add filestore references outside ipfs root (%s)"
,
f
.
root
)
}
...
...
go.mod
浏览文件 @
ec19d4c5
...
...
@@ -12,6 +12,7 @@ require (
github.com/fatih/color v1.7.0 // indirect
github.com/fsnotify/fsnotify v1.4.7
github.com/gogo/protobuf v1.2.1
github.com/golangci/golangci-lint v1.16.0
github.com/hashicorp/go-multierror v1.0.0
github.com/hashicorp/golang-lru v0.5.1
github.com/hsanjuan/go-libp2p-http v0.0.2
...
...
@@ -120,9 +121,9 @@ require (
go.uber.org/goleak v0.10.0 // indirect
go.uber.org/multierr v1.1.0 // indirect
golang.org/x/net v0.0.0-20190424112056-4829fb13d2c6 // indirect
golang.org/x/sync v0.0.0-20190423024810-112230192c58 // indirect
golang.org/x/sys v0.0.0-20190426135247-a129542de9ae
golang.org/x/text v0.3.2 // indirect
golang.org/x/tools v0.0.0-20190425222832-ad9eeb80039a // indirect
golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373 // indirect
gopkg.in/cheggaaa/pb.v1 v1.0.28
gotest.tools/gotestsum v0.3.4
...
...
go.sum
浏览文件 @
ec19d4c5
差异被折叠。
点击展开。
mk/golang.mk
浏览文件 @
ec19d4c5
...
...
@@ -65,10 +65,9 @@ test_go_fmt:
.PHONY
:
test_go_fmt
TEST_GO
+=
test_go_fmt
test_go_megacheck
:
@
$(GOCC)
get honnef.co/go/tools/cmd/megacheck
@
for
pkg
in
$
(
go-pkgs
)
;
do
megacheck
"
$$
pkg"
;
done
.PHONY
:
megacheck
test_go_lint
:
test/bin/golangci-lint
golangci-lint run ./...
.PHONY
:
test_go_lint
test_go
:
$(TEST_GO)
...
...
test/bin/Rules.mk
浏览文件 @
ec19d4c5
...
...
@@ -54,6 +54,9 @@ $(d)/gocovmerge:
$(call go-build,github.com/Kubuxu/gocovmerge)
TGTS_$(d) += $(d)/gocovmerge
$(d)/golangci-lint:
$(call go-build,github.com/golangci/golangci-lint/cmd/golangci-lint)
TGTS_$(d) += $(d)/golangci-lint
$(TGTS_$(d)): $$(DEPS_GO)
...
...
test/dependencies/dependencies.go
浏览文件 @
ec19d4c5
...
...
@@ -4,6 +4,7 @@ package tools
import
(
_
"github.com/Kubuxu/gocovmerge"
_
"github.com/golangci/golangci-lint/cmd/golangci-lint"
_
"github.com/ipfs/go-cidutil/cid-fmt"
_
"github.com/ipfs/hang-fds"
_
"github.com/jbenet/go-random-files/random-files"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论