diff --git a/assets/bindata.go b/assets/bindata.go index 605b5945438e1fe2eaf8a6571cca7ecda12d5599..e80a04d5c999fceb0fde73ac4fef61652cdb4651 100644 --- a/assets/bindata.go +++ b/assets/bindata.go @@ -370,18 +370,18 @@ type bintree struct { } var _bintree = &bintree{nil, map[string]*bintree{ - "dir-index-html": &bintree{nil, map[string]*bintree{ - "dir-index.html": &bintree{dirIndexHtmlDirIndexHtml, map[string]*bintree{}}, - "knownIcons.txt": &bintree{dirIndexHtmlKnowniconsTxt, map[string]*bintree{}}, + "dir-index-html": {nil, map[string]*bintree{ + "dir-index.html": {dirIndexHtmlDirIndexHtml, map[string]*bintree{}}, + "knownIcons.txt": {dirIndexHtmlKnowniconsTxt, map[string]*bintree{}}, }}, - "init-doc": &bintree{nil, map[string]*bintree{ - "about": &bintree{initDocAbout, map[string]*bintree{}}, - "contact": &bintree{initDocContact, map[string]*bintree{}}, - "help": &bintree{initDocHelp, map[string]*bintree{}}, - "ping": &bintree{initDocPing, map[string]*bintree{}}, - "quick-start": &bintree{initDocQuickStart, map[string]*bintree{}}, - "readme": &bintree{initDocReadme, map[string]*bintree{}}, - "security-notes": &bintree{initDocSecurityNotes, map[string]*bintree{}}, + "init-doc": {nil, map[string]*bintree{ + "about": {initDocAbout, map[string]*bintree{}}, + "contact": {initDocContact, map[string]*bintree{}}, + "help": {initDocHelp, map[string]*bintree{}}, + "ping": {initDocPing, map[string]*bintree{}}, + "quick-start": {initDocQuickStart, map[string]*bintree{}}, + "readme": {initDocReadme, map[string]*bintree{}}, + "security-notes": {initDocSecurityNotes, map[string]*bintree{}}, }}, }} diff --git a/core/commands/pin/pin.go b/core/commands/pin/pin.go index a951bac950d08ad3fb62f8ff82ec871d1d08bb50..4be060ae9267143453cb9992b2c179b30073e5e2 100644 --- a/core/commands/pin/pin.go +++ b/core/commands/pin/pin.go @@ -682,7 +682,7 @@ func pinVerify(ctx context.Context, n *core.IpfsNode, opts pinVerifyOpts, enc ci if err := verifcid.ValidateCid(root); err != nil { status := PinStatus{Ok: false} if opts.explain { - status.BadNodes = []BadNode{BadNode{Cid: enc.Encode(key), Err: err.Error()}} + status.BadNodes = []BadNode{{Cid: enc.Encode(key), Err: err.Error()}} } visited[key] = status return status @@ -692,7 +692,7 @@ func pinVerify(ctx context.Context, n *core.IpfsNode, opts pinVerifyOpts, enc ci if err != nil { status := PinStatus{Ok: false} if opts.explain { - status.BadNodes = []BadNode{BadNode{Cid: enc.Encode(key), Err: err.Error()}} + status.BadNodes = []BadNode{{Cid: enc.Encode(key), Err: err.Error()}} } visited[key] = status return status diff --git a/core/commands/root.go b/core/commands/root.go index 1440c31b7ebf885deec1e1e85763b77bf11ace35..f367d06e2bd6e4c660ad398fd14cb33b799ed08e 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -166,7 +166,7 @@ var VersionROCmd = &cmds.Command{} var rootROSubcommands = map[string]*cmds.Command{ "commands": CommandsDaemonROCmd, "cat": CatCmd, - "block": &cmds.Command{ + "block": { Subcommands: map[string]*cmds.Command{ "stat": blockStatCmd, "get": blockGetCmd, diff --git a/namesys/dns.go b/namesys/dns.go index 0b48ad34bdb8348500396bb59f20d90e98eae811..738612f46b2328b42fcf012033dcd6ba5e506880 100644 --- a/namesys/dns.go +++ b/namesys/dns.go @@ -3,9 +3,9 @@ package namesys import ( "context" "errors" + "fmt" "net" "strings" - "fmt" path "github.com/ipfs/go-path" opts "github.com/ipfs/interface-go-ipfs-core/options/namesys" diff --git a/namesys/dns_test.go b/namesys/dns_test.go index 653c3c7887f22930be1eab267e357f3b920f23cd..5a0e2a7d2ffd54ee7e9c49eaba9d6bb87525120d 100644 --- a/namesys/dns_test.go +++ b/namesys/dns_test.go @@ -61,72 +61,72 @@ func TestDnsEntryParsing(t *testing.T) { func newMockDNS() *mockDNS { return &mockDNS{ entries: map[string][]string{ - "multihash.example.com.": []string{ + "multihash.example.com.": { "dnslink=QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", }, - "ipfs.example.com.": []string{ + "ipfs.example.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", }, - "_dnslink.dipfs.example.com.": []string{ + "_dnslink.dipfs.example.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", }, - "dns1.example.com.": []string{ + "dns1.example.com.": { "dnslink=/ipns/ipfs.example.com", }, - "dns2.example.com.": []string{ + "dns2.example.com.": { "dnslink=/ipns/dns1.example.com", }, - "multi.example.com.": []string{ + "multi.example.com.": { "some stuff", "dnslink=/ipns/dns1.example.com", "masked dnslink=/ipns/example.invalid", }, - "equals.example.com.": []string{ + "equals.example.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/=equals", }, - "loop1.example.com.": []string{ + "loop1.example.com.": { "dnslink=/ipns/loop2.example.com", }, - "loop2.example.com.": []string{ + "loop2.example.com.": { "dnslink=/ipns/loop1.example.com", }, - "_dnslink.dloop1.example.com.": []string{ + "_dnslink.dloop1.example.com.": { "dnslink=/ipns/loop2.example.com", }, - "_dnslink.dloop2.example.com.": []string{ + "_dnslink.dloop2.example.com.": { "dnslink=/ipns/loop1.example.com", }, - "bad.example.com.": []string{ + "bad.example.com.": { "dnslink=", }, - "withsegment.example.com.": []string{ + "withsegment.example.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/sub/segment", }, - "withrecsegment.example.com.": []string{ + "withrecsegment.example.com.": { "dnslink=/ipns/withsegment.example.com/subsub", }, - "withtrailing.example.com.": []string{ + "withtrailing.example.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD/sub/", }, - "withtrailingrec.example.com.": []string{ + "withtrailingrec.example.com.": { "dnslink=/ipns/withtrailing.example.com/segment/", }, - "double.example.com.": []string{ + "double.example.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", }, - "_dnslink.double.example.com.": []string{ + "_dnslink.double.example.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", }, - "double.conflict.com.": []string{ + "double.conflict.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjD", }, - "_dnslink.conflict.example.com.": []string{ + "_dnslink.conflict.example.com.": { "dnslink=/ipfs/QmY3hE8xgFCjGcz6PHgnvJz5HZi1BaKRfPkn1ghZUcYMjE", }, - "fqdn.example.com.": []string{ + "fqdn.example.com.": { "dnslink=/ipfs/QmYvMB9yrsSf7RKBghkfwmHJkzJhW2ZgVwq3LxBXXPasFr", }, - "www.wealdtech.eth.link.": []string{ + "www.wealdtech.eth.link.": { "dnslink=/ipns/ipfs.example.com", }, },