mirror of
https://github.com/ipfs/kubo.git
synced 2025-05-17 23:16:11 +08:00
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.
This commit is contained in:
@ -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{}},
|
||||
}},
|
||||
}}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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"
|
||||
|
@ -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",
|
||||
},
|
||||
},
|
||||
|
Reference in New Issue
Block a user