Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does ./... mean in Go?

I usually see ./... in golang
for example go test ./...or go fmt ./...

only know the meaning of one or two dots

like image 636
what is what Avatar asked Mar 09 '17 09:03

what is what


People also ask

What does & symbol mean in Go?

Go uses pointers like C or C++. The * symbol is used to declare a pointer and to dereference. The & symbol points to the address of the stored value.

What means := IN Go?

The := syntax is shorthand for declaring and initializing a variable, example f := "car" is the short form of var f string = "car" The short variable declaration operator( := ) can only be used for declaring local variables.

What does the asterisk mean in Go?

In Go a pointer is represented using the * (asterisk) character followed by the type of the stored value. In the zero function xPtr is a pointer to an int . * is also used to “dereference” pointer variables. Dereferencing a pointer gives us access to the value the pointer points to.

What does i ++ mean in Golang?

According to Language Specification, http://golang.org/ref/spec#IncDec_statements, i++ is a IncDec statements , which is a statement , but not a expression . As for args[index] , index must be a expression .


2 Answers

It means perform the action on all packages under a directory. So for example go test ./... runs go test on the current dir + all subdirectories.

The Go tool documentation is here:

https://golang.org/doc/cmd

like image 123
Kenny Grant Avatar answered Nov 13 '22 08:11

Kenny Grant


./... means a recursive action ( ... ) from your current directory ( ./ )

like image 25
Chryor Avatar answered Nov 13 '22 08:11

Chryor