Building all the code with Go and '. / ...'

According to the Ethereum Developer's Guide :

You can create all the code with the go tool by putting the resulting binary in $ GOPATH / bin.

go install -v ./... 

What does ./... in context:

 go install -v ./... 
+5
source share
1 answer

This will install the " main " packages found in the current or subdirectory,

"subdirectories": this is what the syntax means ./...
It forces go install consider not only the current folder / package ('.'), But also those that are in subfolders: " ... "

See “ What is a smart way to build a Go project : you can have multiple“ main ”packages in a library-based development:

Moving the main.go file from your root allows you to create an application in terms of a library. An application binary is just a client of your application library.

Sometimes you may want users to interact in several ways to create multiple binaries.
For example, if you have an adder package that allows users to add numbers together, you might want to release a command line version as well as a web version.
You can easily do this by organizing your project as follows:

 adder/ adder.go cmd/ adder/ main.go adder-server/ main.go 

Users can install the adder binaries with go get using the ellipsis:

 $ go get github.com/benbjohnson/adder/... 

And will, your user has an “adder” and “adder server” installed!

Similarly, a go install -v ./... also install the “adder” and “adder server”.

Note. -v prints package names as they are compiled.

+6
source

Source: https://habr.com/ru/post/1269389/


All Articles