@cryptotaxi247 / kubo / commits / 17d533909

all: gofmt -s

This "simplify" flag mainly removes redundant types in expressions. Not particularly important, but a nice change that also makes gopls not show warnings.

Daniel Martí committed Feb 5, 2021 at 14:26 UTC 17d533909b88a47af8dedb0aa29e4943f7d383e9
5 files changed +37 -37
assets/bindata.go
+11 -11
@@ -370,18 +370,18 @@ type bintree struct {
370 }
371
372 var _bintree = &bintree{nil, map[string]*bintree{
373 - "dir-index-html": &bintree{nil, map[string]*bintree{
374 - "dir-index.html": &bintree{dirIndexHtmlDirIndexHtml, map[string]*bintree{}},
375 - "knownIcons.txt": &bintree{dirIndexHtmlKnowniconsTxt, map[string]*bintree{}},
373 + "dir-index-html": {nil, map[string]*bintree{
374 + "dir-index.html": {dirIndexHtmlDirIndexHtml, map[string]*bintree{}},
375 + "knownIcons.txt": {dirIndexHtmlKnowniconsTxt, map[string]*bintree{}},
376 }},
377 - "init-doc": &bintree{nil, map[string]*bintree{
378 - "about": &bintree{initDocAbout, map[string]*bintree{}},
379 - "contact": &bintree{initDocContact, map[string]*bintree{}},
380 - "help": &bintree{initDocHelp, map[string]*bintree{}},
381 - "ping": &bintree{initDocPing, map[string]*bintree{}},
382 - "quick-start": &bintree{initDocQuickStart, map[string]*bintree{}},
383 - "readme": &bintree{initDocReadme, map[string]*bintree{}},
384 - "security-notes": &bintree{initDocSecurityNotes, map[string]*bintree{}},
377 + "init-doc": {nil, map[string]*bintree{
378 + "about": {initDocAbout, map[string]*bintree{}},
379 + "contact": {initDocContact, map[string]*bintree{}},
380 + "help": {initDocHelp, map[string]*bintree{}},
381 + "ping": {initDocPing, map[string]*bintree{}},
382 + "quick-start": {initDocQuickStart, map[string]*bintree{}},
383 + "readme": {initDocReadme, map[string]*bintree{}},
384 + "security-notes": {initDocSecurityNotes, map[string]*bintree{}},
385 }},
386 }}
387
core/commands/pin/pin.go
+2 -2
@@ -682,7 +682,7 @@ func pinVerify(ctx context.Context, n *core.IpfsNode, opts pinVerifyOpts, enc ci
682 if err := verifcid.ValidateCid(root); err != nil {
683 status := PinStatus{Ok: false}
684 if opts.explain {
685 - status.BadNodes = []BadNode{BadNode{Cid: enc.Encode(key), Err: err.Error()}}
685 + status.BadNodes = []BadNode{{Cid: enc.Encode(key), Err: err.Error()}}
686 }
687 visited[key] = status
688 return status
@@ -692,7 +692,7 @@ func pinVerify(ctx context.Context, n *core.IpfsNode, opts pinVerifyOpts, enc ci
692 if err != nil {
693 status := PinStatus{Ok: false}
694 if opts.explain {
695 - status.BadNodes = []BadNode{BadNode{Cid: enc.Encode(key), Err: err.Error()}}
695 + status.BadNodes = []BadNode{{Cid: enc.Encode(key), Err: err.Error()}}
696 }
697 visited[key] = status
698 return status
core/commands/root.go
+1 -1
@@ -166,7 +166,7 @@ var VersionROCmd = &cmds.Command{}
166 var rootROSubcommands = map[string]*cmds.Command{
167 "commands": CommandsDaemonROCmd,
168 "cat": CatCmd,
169 - "block": &cmds.Command{
169 + "block": {
170 Subcommands: map[string]*cmds.Command{
171 "stat": blockStatCmd,
172 "get": blockGetCmd,
namesys/dns.go
+1 -1
@@ -3,9 +3,9 @@ package namesys
3 import (
4 "context"
5 "errors"
6 + "fmt"
7 "net"
8 "strings"
8 - "fmt"
9
10 path "github.com/ipfs/go-path"
11 opts "github.com/ipfs/interface-go-ipfs-core/options/namesys"
namesys/dns_test.go
+22 -22
@@ -61,72 +61,72 @@ func TestDnsEntryParsing(t *testing.T) {
61 func newMockDNS() *mockDNS {
62 return &mockDNS{
63 entries: map[string][]string{
64 - "multihash.example.com.": []string{
64 + "multihash.example.com.": {
65 "dnslink=QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD",
66 },
67 - "ipfs.example.com.": []string{
67 + "ipfs.example.com.": {
68 "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD",
69 },
70 - "_dnslink.dipfs.example.com.": []string{
70 + "_dnslink.dipfs.example.com.": {
71 "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD",
72 },
73 - "dns1.example.com.": []string{
73 + "dns1.example.com.": {
74 "dnslink=/ipns/ipfs.example.com",
75 },
76 - "dns2.example.com.": []string{
76 + "dns2.example.com.": {
77 "dnslink=/ipns/dns1.example.com",
78 },
79 - "multi.example.com.": []string{
79 + "multi.example.com.": {
80 "some stuff",
81 "dnslink=/ipns/dns1.example.com",
82 "masked dnslink=/ipns/example.invalid",
83 },
84 - "equals.example.com.": []string{
84 + "equals.example.com.": {
85 "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/=equals",
86 },
87 - "loop1.example.com.": []string{
87 + "loop1.example.com.": {
88 "dnslink=/ipns/loop2.example.com",
89 },
90 - "loop2.example.com.": []string{
90 + "loop2.example.com.": {
91 "dnslink=/ipns/loop1.example.com",
92 },
93 - "_dnslink.dloop1.example.com.": []string{
93 + "_dnslink.dloop1.example.com.": {
94 "dnslink=/ipns/loop2.example.com",
95 },
96 - "_dnslink.dloop2.example.com.": []string{
96 + "_dnslink.dloop2.example.com.": {
97 "dnslink=/ipns/loop1.example.com",
98 },
99 - "bad.example.com.": []string{
99 + "bad.example.com.": {
100 "dnslink=",
101 },
102 - "withsegment.example.com.": []string{
102 + "withsegment.example.com.": {
103 "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/sub/segment",
104 },
105 - "withrecsegment.example.com.": []string{
105 + "withrecsegment.example.com.": {
106 "dnslink=/ipns/withsegment.example.com/subsub",
107 },
108 - "withtrailing.example.com.": []string{
108 + "withtrailing.example.com.": {
109 "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/sub/",
110 },
111 - "withtrailingrec.example.com.": []string{
111 + "withtrailingrec.example.com.": {
112 "dnslink=/ipns/withtrailing.example.com/segment/",
113 },
114 - "double.example.com.": []string{
114 + "double.example.com.": {
115 "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD",
116 },
117 - "_dnslink.double.example.com.": []string{
117 + "_dnslink.double.example.com.": {
118 "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD",
119 },
120 - "double.conflict.com.": []string{
120 + "double.conflict.com.": {
121 "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD",
122 },
123 - "_dnslink.conflict.example.com.": []string{
123 + "_dnslink.conflict.example.com.": {
124 "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjE",
125 },
126 - "fqdn.example.com.": []string{
126 + "fqdn.example.com.": {
127 "dnslink=/ipfs/QmYvMB9yrsSf7RKBghkfwmHJkzJhW2ZgVwq3LxBXXPasFr",
128 },
129 - "www.wealdtech.eth.link.": []string{
129 + "www.wealdtech.eth.link.": {
130 "dnslink=/ipns/ipfs.example.com",
131 },
132 },