-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
What version of Go are you using (go version)?
go version go1.10 windows/amd64
Does this issue reproduce with the latest release?
1.10 is the latest at this moment
What operating system and processor architecture are you using (go env)?
GOARCH=amd64
GOOS=windows
What did you do?
I have small test program with two small dummy libraries.
Go program in the src
has path github.com/user/hello
package main
import (
"fmt"
// Libraries bellow are not automatically generated in pkg
"github.com/user/stringutil"
"github.com/user/tttt"
)
func main() {
fmt.Printf(stringutil.Reverse("\nHello, world.\n"))
fmt.Println(add(85,tttt.Tttt(9)))
}
add()
function is in separate file, also in hello
directory:
package main
func add(x int, y int) int {
return x + y
}
When I don't have the above libraries compiled and just use go install hello
program is installed and works but the pkg
directory is not created and no stringutil.a
and tttt.a
.
If I want to have libraries generated I have to use go install
on every library, in which case pkg
is generated and libraries in it.
this is not behaviour according to this documentation:
Whenever the go tool installs a package or binary, it also installs whatever dependencies it has. So when you install the hello program
$ go install github.com/user/hello
the stringutil package will be installed as well, automatically.
Note that I have just installed the latest version (1.10) and just start using it as is writing only one dummy program and two dummy libraries one of which is copied from Go documentation.
What did you expect to see?
Dependencies installed automatically in the pkg
What did you see instead?
No pkg
and no installed dependencies