Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does go list ./... do? [duplicate]

Tags:

go

I am having trouble understanding what the following command does.

go list ./...

When I look at the official documentation https://golang.org/cmd/go/#hdr-List_packages, it is not clear to me what the ./... argument is telling the command.

like image 527
Raghav Avatar asked Mar 18 '16 06:03

Raghav


People also ask

Does list accept duplicate values?

List allows duplicates while Set doesn't allow duplicate elements . All the elements of a Set should be unique if you try to insert the duplicate element in Set it would replace the existing value. List permits any number of null values in its collection while Set permits only one null value in its collection.

What happens when you delete duplicates?

When you use the Remove Duplicates feature, the duplicate data will be permanently deleted. Before you delete the duplicates, it's a good idea to copy the original data to another worksheet so you don't accidentally lose any information. Select the range of cells that has duplicate values you want to remove.

Can list have duplicate entries?

If an integer or string or any items in a list are repeated more than one time, they are duplicates.


2 Answers

go list requires an import path for a package and can give you some listing info for the packages matched this way (you may be interested in its -f flag).

./... is a wildcard that matches the current folder and all of its subfolders (execute go help packages to read more about this somewhat hidden feature), and that can be used with all the built-in Go commands.

So go list ./... can list all the Go packages in the current folder and its sub-folders - you may want to call it from GOPATH for example.

like image 62
Dimitar Dimitrov Avatar answered Sep 30 '22 17:09

Dimitar Dimitrov


go list ./...

Here ./ tells to start from the current folder, ... tells to go down recursively.

go list ...

In any folder lists all the packages, including packages of the standard library first followed by external libraries in your go workspace.

like image 32
Emdadul Sawon Avatar answered Sep 30 '22 16:09

Emdadul Sawon