Skip to content

doc/code.html: update description of install command #24506

@toni-rmc

Description

@toni-rmc

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions