mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-27 13:27:50 +08:00
commit
c7d4b8d34c
@ -1,8 +1,8 @@
|
||||
//go:generate git submodule update --init ./dir-index-html
|
||||
//go:generate go run github.com/go-bindata/go-bindata/v3/go-bindata -mode=0644 -modtime=1403768328 -pkg=assets init-doc dir-index-html/dir-index.html dir-index-html/knownIcons.txt
|
||||
//go:generate gofmt -w bindata.go
|
||||
//go:generate gofmt -s -w bindata.go
|
||||
//go:generate sh -c "sed -i \"s/.*BindataVersionHash.*/BindataVersionHash=\\\"$(git hash-object bindata.go)\\\"/\" bindata_version_hash.go"
|
||||
//go:generate gofmt -w bindata_version_hash.go
|
||||
//go:generate gofmt -s -w bindata_version_hash.go
|
||||
package assets
|
||||
|
||||
import (
|
||||
|
||||
@ -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{}},
|
||||
}},
|
||||
}}
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ T="$(mktemp)"
|
||||
find . \
|
||||
-path ./test/sharness -prune \
|
||||
-o -path ./plugin/loader/preload.go -prune \
|
||||
-o -name '*.go' -print0 | xargs -0 gofmt -l > "$T"
|
||||
-o -name '*.go' -print0 | xargs -0 gofmt -s -l > "$T"
|
||||
|
||||
if [ -n "$(cat $T)" ]; then
|
||||
echo "Following Go code is not formatted."
|
||||
|
||||
@ -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",
|
||||
},
|
||||
},
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
#TODO add go lint and go vet
|
||||
|
||||
verify_gofmt() {
|
||||
GOFMT="gofmt -s"
|
||||
cd "$(git rev-parse --show-toplevel)"
|
||||
bad_files=$($GOFMT -l .)
|
||||
cd -
|
||||
if [[ -n $bad_files ]]; then
|
||||
echo "You have to run '$GOFMT' on these files:"
|
||||
echo "$bad_files"
|
||||
false
|
||||
else
|
||||
true
|
||||
fi
|
||||
}
|
||||
|
||||
verify_gofmt
|
||||
Loading…
Reference in New Issue
Block a user