style: run gofumpt
This commit was moved from ipfs/boxo@c5a805eed56de5df9c8a220a4ce72b7bc3a0ae38
Jorropo committed
Aug 21, 2023 at 10:01 UTC
334308f532243a1a3f4ff5ab1a988c4a76b5891e
11 files changed
+43
-30
core/coreiface/options/block.go
+4
-3
@@ -17,8 +17,10 @@ type BlockRmSettings struct {
17
Force bool
18
}
19
20
-type BlockPutOption func(*BlockPutSettings) error
21
-type BlockRmOption func(*BlockRmSettings) error
20
+type (
21
+ BlockPutOption func(*BlockPutSettings) error
22
+ BlockRmOption func(*BlockRmSettings) error
23
+)
24
25
func BlockPutOptions(opts ...BlockPutOption) (*BlockPutSettings, error) {
26
var cidPrefix cid.Prefix
@@ -131,7 +133,6 @@ func (blockOpts) Format(format string) BlockPutOption {
133
134
return nil
135
}
134
-
136
}
137
138
// Hash is an option for Block.Put which specifies the multihash settings to use
core/coreiface/options/dht.go
+4
-2
@@ -8,8 +8,10 @@ type DhtFindProvidersSettings struct {
8
NumProviders int
9
}
10
11
-type DhtProvideOption func(*DhtProvideSettings) error
12
-type DhtFindProvidersOption func(*DhtFindProvidersSettings) error
11
+type (
12
+ DhtProvideOption func(*DhtProvideSettings) error
13
+ DhtFindProvidersOption func(*DhtFindProvidersSettings) error
14
+)
15
16
func DhtProvideOptions(opts ...DhtProvideOption) (*DhtProvideSettings, error) {
17
options := &DhtProvideSettings{
core/coreiface/options/key.go
+4
-2
@@ -16,8 +16,10 @@ type KeyRenameSettings struct {
16
Force bool
17
}
18
19
-type KeyGenerateOption func(*KeyGenerateSettings) error
20
-type KeyRenameOption func(*KeyRenameSettings) error
19
+type (
20
+ KeyGenerateOption func(*KeyGenerateSettings) error
21
+ KeyRenameOption func(*KeyRenameSettings) error
22
+)
23
24
func KeyGenerateOptions(opts ...KeyGenerateOption) (*KeyGenerateSettings, error) {
25
options := &KeyGenerateSettings{
core/coreiface/options/name.go
+4
-2
@@ -24,8 +24,10 @@ type NameResolveSettings struct {
24
ResolveOpts []ropts.ResolveOpt
25
}
26
27
-type NamePublishOption func(*NamePublishSettings) error
28
-type NameResolveOption func(*NameResolveSettings) error
27
+type (
28
+ NamePublishOption func(*NamePublishSettings) error
29
+ NameResolveOption func(*NameResolveSettings) error
30
+)
31
32
func NamePublishOptions(opts ...NamePublishOption) (*NamePublishSettings, error) {
33
options := &NamePublishSettings{
core/coreiface/options/object.go
+5
-3
@@ -14,9 +14,11 @@ type ObjectAddLinkSettings struct {
14
Create bool
15
}
16
17
-type ObjectNewOption func(*ObjectNewSettings) error
18
-type ObjectPutOption func(*ObjectPutSettings) error
19
-type ObjectAddLinkOption func(*ObjectAddLinkSettings) error
17
+type (
18
+ ObjectNewOption func(*ObjectNewSettings) error
19
+ ObjectPutOption func(*ObjectPutSettings) error
20
+ ObjectAddLinkOption func(*ObjectAddLinkSettings) error
21
+)
22
23
func ObjectNewOptions(opts ...ObjectNewOption) (*ObjectNewSettings, error) {
24
options := &ObjectNewSettings{
core/coreiface/options/pubsub.go
+4
-2
@@ -8,8 +8,10 @@ type PubSubSubscribeSettings struct {
8
Discover bool
9
}
10
11
-type PubSubPeersOption func(*PubSubPeersSettings) error
12
-type PubSubSubscribeOption func(*PubSubSubscribeSettings) error
11
+type (
12
+ PubSubPeersOption func(*PubSubPeersSettings) error
13
+ PubSubSubscribeOption func(*PubSubSubscribeSettings) error
14
+)
15
16
func PubSubPeersOptions(opts ...PubSubPeersOption) (*PubSubPeersSettings, error) {
17
options := &PubSubPeersSettings{
core/coreiface/options/unixfs.go
+4
-2
@@ -43,8 +43,10 @@ type UnixfsLsSettings struct {
43
UseCumulativeSize bool
44
}
45
46
-type UnixfsAddOption func(*UnixfsAddSettings) error
47
-type UnixfsLsOption func(*UnixfsLsSettings) error
46
+type (
47
+ UnixfsAddOption func(*UnixfsAddSettings) error
48
+ UnixfsLsOption func(*UnixfsLsSettings) error
49
+)
50
51
func UnixfsAddOptions(opts ...UnixfsAddOption) (*UnixfsAddSettings, cid.Prefix, error) {
52
options := &UnixfsAddSettings{
core/coreiface/tests/dag.go
+7
-9
@@ -31,15 +31,13 @@ func (tp *TestSuite) TestDag(t *testing.T) {
31
t.Run("TestBatch", tp.TestBatch)
32
}
33
34
-var (
35
- treeExpected = map[string]struct{}{
36
- "a": {},
37
- "b": {},
38
- "c": {},
39
- "c/d": {},
40
- "c/e": {},
41
- }
42
-)
34
+var treeExpected = map[string]struct{}{
35
+ "a": {},
36
+ "b": {},
37
+ "c": {},
38
+ "c/d": {},
39
+ "c/e": {},
40
+}
41
42
func (tp *TestSuite) TestPut(t *testing.T) {
43
ctx, cancel := context.WithCancel(context.Background())
core/coreiface/tests/name.go
+1
-1
@@ -164,4 +164,4 @@ func (tp *TestSuite) TestBasicPublishResolveTimeout(t *testing.T) {
164
require.NoError(t, err)
165
}
166
167
-//TODO: When swarm api is created, add multinode tests
167
+// TODO: When swarm api is created, add multinode tests
core/coreiface/tests/object.go
+1
-1
@@ -74,7 +74,7 @@ func (tp *TestSuite) TestObjectPut(t *testing.T) {
74
t.Fatal(err)
75
}
76
77
- p2, err := api.Object().Put(ctx, strings.NewReader(`{"Data":"YmFy"}`), opt.Object.DataType("base64")) //bar
77
+ p2, err := api.Object().Put(ctx, strings.NewReader(`{"Data":"YmFy"}`), opt.Object.DataType("base64")) // bar
78
if err != nil {
79
t.Fatal(err)
80
}
core/coreiface/tests/unixfs.go
+5
-3
@@ -53,8 +53,10 @@ func (tp *TestSuite) TestUnixfs(t *testing.T) {
53
}
54
55
// `echo -n 'hello, world!' | ipfs add`
56
-var hello = "/ipfs/QmQy2Dw4Wk7rdJKjThjYXzfFJNaRKRHhHP5gHHXroJMYxk"
57
-var helloStr = "hello, world!"
56
+var (
57
+ hello = "/ipfs/QmQy2Dw4Wk7rdJKjThjYXzfFJNaRKRHhHP5gHHXroJMYxk"
58
+ helloStr = "hello, world!"
59
+)
60
61
// `echo -n | ipfs add`
62
var emptyFile = "/ipfs/QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH"
@@ -213,7 +215,7 @@ func (tp *TestSuite) TestAdd(t *testing.T) {
215
path: "/ipfs/bafkqaaa",
216
opts: []options.UnixfsAddOption{options.Unixfs.InlineLimit(0), options.Unixfs.Inline(true), options.Unixfs.RawLeaves(true)},
217
},
216
- { //TODO: after coreapi add is used in `ipfs add`, consider making this default for inline
218
+ { // TODO: after coreapi add is used in `ipfs add`, consider making this default for inline
219
name: "addInlineRaw",
220
data: strFile(helloStr),
221
path: "/ipfs/bafkqadlimvwgy3zmeb3w64tmmqqq",