Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No pkg installed #26079

Closed
TaurusD opened this issue Jun 27, 2018 · 3 comments
Closed

No pkg installed #26079

TaurusD opened this issue Jun 27, 2018 · 3 comments
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@TaurusD
Copy link

TaurusD commented Jun 27, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.10.3 windows/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\p4446\AppData\Local\go-build
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\XXXXX\Documents\go-work
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\XXXXX\AppData\Local\Temp\go-build121904390=/tmp/go-build -gno-record-gcc-switches

What did you do?

I followed the tutorial on https://golang.org/doc/code.html till the section Your First Library.

What did you expect to see?

When I run command go install github.com/user/hello, it's expected to install hello.exe in folder bin and pakage stringutil.a in folder pkg.

What did you see instead?

I got only hello.exe in bin, but nothing in pkg.

@myitcv
Copy link
Member

myitcv commented Jun 27, 2018

Thank you - this is indeed an error in the example at https://golang.org/doc/code.html

This behaviour changed in Go 1.10: https://golang.org/doc/go1.10#build

The go install command now installs only the packages and commands listed directly on the command line. For example, go install cmd/gofmt installs the gofmt program but not any of the packages on which it depends.

You can safely ignore the fact that stringutil.a is not in the pkg directory structure. To all intents and purposes it doesn't make any difference.

@myitcv myitcv added Documentation Issues describing a change to documentation. NeedsFix The path to resolution is known, but the work has not been done. labels Jun 27, 2018
@myitcv myitcv added this to the Go1.11 milestone Jun 27, 2018
@agnivade
Copy link
Contributor

Duplicate of #24506, for which a CL has already been created, but waiting on OP (@jdparkinson93).

@myitcv
Copy link
Member

myitcv commented Jun 27, 2018

Thanks @agnivade

@myitcv myitcv closed this as completed Jun 27, 2018
@golang golang locked and limited conversation to collaborators Jun 27, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation Issues describing a change to documentation. FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants