1

In the -go-ethereum client directory I've run the command find . -name \*.md -print looking for README.md files. The output is as follows:

    ./.github/CONTRIBUTING.md
    ./.github/ISSUE_TEMPLATE.md
    ./build/ci-notes.md
    ./contracts/ens/README.md
    ./crypto/secp256k1/libsecp256k1/README.md
    ./log/README.md
    ./log/README_ETHEREUM.md
    ./README.md
    ./swarm/dev/README.md
    ./vendor/bazil.org/fuse/README.md
    ./vendor/github.com/aristanetworks/goarista/README.md
    ./vendor/github.com/Azure/azure-sdk-for-go/CHANGELOG.md
    ./vendor/github.com/Azure/azure-sdk-for-go/README.md
    ./vendor/github.com/Azure/azure-storage-go/README.md
    ./vendor/github.com/btcsuite/btcd/btcec/README.md
    ./vendor/github.com/cespare/cp/README.md
    ./vendor/github.com/davecgh/go-spew/README.md
    ./vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md
    ./vendor/github.com/dgrijalva/jwt-go/README.md
    ./vendor/github.com/dgrijalva/jwt-go/VERSION_HISTORY.md
    ./vendor/github.com/docker/docker/pkg/reexec/README.md
    ./vendor/github.com/edsrzf/mmap-go/README.md
    ./vendor/github.com/fatih/color/LICENSE.md
    ./vendor/github.com/fatih/color/README.md
    ./vendor/github.com/gizak/termui/README.md
    ./vendor/github.com/go-stack/stack/LICENSE.md
    ./vendor/github.com/go-stack/stack/README.md
    ./vendor/github.com/hashicorp/golang-lru/README.md
    ./vendor/github.com/huin/goupnp/README.md
    ./vendor/github.com/jackpal/go-nat-pmp/README.md
    ./vendor/github.com/karalabe/hid/LICENSE.md
    ./vendor/github.com/karalabe/hid/README.md
    ./vendor/github.com/maruel/panicparse/README.md
    ./vendor/github.com/mattn/go-colorable/README.md
    ./vendor/github.com/mattn/go-isatty/README.md
    ./vendor/github.com/mitchellh/go-wordwrap/LICENSE.md
    ./vendor/github.com/mitchellh/go-wordwrap/README.md
    ./vendor/github.com/naoina/go-stringutil/README.md
    ./vendor/github.com/naoina/toml/README.md
    ./vendor/github.com/nsf/termbox-go/README.md
    ./vendor/github.com/olekukonko/tablewriter/LICENCE.md
    ./vendor/github.com/olekukonko/tablewriter/README.md
    ./vendor/github.com/pborman/uuid/CONTRIBUTING.md
    ./vendor/github.com/pborman/uuid/README.md
    ./vendor/github.com/peterh/liner/README.md
    ./vendor/github.com/rcrowley/go-metrics/memory.md
    ./vendor/github.com/rcrowley/go-metrics/README.md
    ./vendor/github.com/rjeczalik/notify/README.md
    ./vendor/github.com/rs/cors/README.md
    ./vendor/github.com/rs/xhandler/README.md
    ./vendor/github.com/syndtr/goleveldb/README.md
    ./vendor/golang.org/x/crypto/CONTRIBUTING.md
    ./vendor/golang.org/x/net/CONTRIBUTING.md
    ./vendor/golang.org/x/sys/CONTRIBUTING.md
    ./vendor/golang.org/x/text/CONTRIBUTING.md
    ./vendor/golang.org/x/tools/CONTRIBUTING.md
    ./vendor/gopkg.in/check.v1/README.md
    ./vendor/gopkg.in/fatih/set.v0/LICENSE.md
    ./vendor/gopkg.in/fatih/set.v0/README.md
    ./vendor/gopkg.in/karalabe/cookiejar.v2/README.md
    ./vendor/gopkg.in/natefinch/npipe.v2/README.md
    ./vendor/gopkg.in/sourcemap.v1/README.md
    ./vendor/gopkg.in/urfave/cli.v1/CHANGELOG.md
    ./vendor/gopkg.in/urfave/cli.v1/README.md

Based on this it looks like all the "3rd party" dependencies are located in the vendor/ directory. Is that the case? Why is this directory called as vendor?

1

Based on this it looks like all the "3rd party" dependencies are located in the vendor/ directory. Is that the case?

Yes, correct.

Why is this directory called as vendor?

This is a convention in Go, introduced in golang 1.6 (experimentally in 1.5).

See the official documentation, here: https://golang.org/cmd/go/#hdr-Vendor_Directories

In short:

Go 1.6 includes support for using local copies of external dependencies to satisfy imports of those dependencies, often referred to as vendoring.

Code below a directory named "vendor" is importable only by code in the directory tree rooted at the parent of "vendor", and only using an import path that omits the prefix up to and including the vendor element.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.