Skip to content

doc/tutorial/call-module-code: recap the directory structure from the previous step? #41573

Closed
@bcetienne

Description

@bcetienne

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

$ go version go1.15.2 darwin/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="/Users/etienne/Library/Caches/go-build"
GOENV="/Users/etienne/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/etienne/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/etienne/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/etienne/Desktop/greetings/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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/sb/6q_vnpy53xn95mr4kj7h9lvc0000gq/T/go-build921607341=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I followed the guidelines for learning Go on the official website.
I first did this part which is not a problem (https://golang.org/doc/tutorial/create-module) but in the second part (https://golang.org/doc/tutorial/call-module-code), the build command from the hello directory doesn't work.

I tried again just copying and pasting the provided code but nothing changes.

Here is my go.mod file in the hello directory.

module hello

go 1.15

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

Here is my structure

image

What did you expect to see?

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


What did you see instead?

$ go build
hello.go:6:2: example.com/greetings@v0.0.0-00010101000000-000000000000: replacement directory ../greetings does not exist

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions