Reputation: 1416
I want to create a documentation for my own Project in folder "MyOwnProject". Standard seems to be Godoc where the help tells me to use godoc package [name...] It doesn't seem to work tough:
godoc package MyOwnProject -path ..../go
-> Cannot find file ..../go/src/pkg/package
godoc MyOwnProject -path ..../go
-> Cannot find file ..../go/src/pkg/MyOwnProject
For one, the directory /src/pkg/ it adds doesn't make any sense, stuff is either in go/pkg OR go/src. Next it somehow seems to be looking for a single file. I want it to work on all files given for that project. What am I doing wrong with my parameters?
Upvotes: 1
Views: 517
Reputation: 32923
The word package
in usage: godoc package [name ...]
is a placeholder for the full name of your package, and [name ...]
is a placeholder for the name of a specific function/variable which you want to restrict the search to. The three dots mean that you can specify more than one name. The square brackets mean that it is optional.
If your package is located in $GOPATH/src/MyOwnProject
, then its full name is simply MyOwnProject
and all you need to type to get the full documentation of your package is:
godoc MyOwnProject
Upvotes: 1