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

x/website: improve /doc/tutorial/call-module-code to adapt to the Go 1.16 #44479

Closed
davidgarciaMontreal opened this issue Feb 21, 2021 · 2 comments
Labels
Documentation FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@davidgarciaMontreal
Copy link

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

$ go version
go version go1.16 linux/amd64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/cpradm/.cache/go-build"
GOENV="/home/cpradm/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/cpradm/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/cpradm/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/cpradm/git/ptc-cpr-go/hello/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3616770460=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Step 5.2 doesn't work in go version 1.16. The workaround is to add the require directive.

working module hello output:
module hello

go 1.16

require example.com/greetings v0.0.0

replace example.com/greetings => ../greetings

What did you expect to see?

$ go build
go: found example.com/greetings in example.com/greetings v0.0.0-00010101000000-0

What did you see instead?

$ go build
hello.go:5:5: module example.com/greetings provides package example.com/greetings and is replaced but not required; to add it:
go get example.com/greetings

@gopherbot gopherbot added this to the Unreleased milestone Feb 21, 2021
@oiooj oiooj added Documentation NeedsFix The path to resolution is known, but the work has not been done. labels Feb 22, 2021
@oiooj oiooj changed the title x/website: https://golang.org/doc/tutorial/call-module-code x/website: improve /doc/tutorial/call-module-code to adapt to the Go 1.16 Feb 22, 2021
@fzipp
Copy link
Contributor

fzipp commented Mar 4, 2021

Duplicate of #44241 (comment)

This is already fixed on tip.golang.org: https://tip.golang.org/doc/tutorial/call-module-code

@dmitshur
Copy link
Contributor

I agree it looks like this has been fixed, so closing. Please let us know if we missed something.

@golang golang locked and limited conversation to collaborators Apr 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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

5 participants