Skip to content

x/website: Tutorial: Get started with Go is not working correctly #44021

@40cc66

Description

@40cc66

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

$ go version
go version go1.15.7 linux/amd64

Does this issue reproduce with the latest release?

I do not know. But it reproduces on Windows.

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/stanislav/.cache/go-build"
GOENV="/home/stanislav/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/stanislav/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/stanislav/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"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/stanislav/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-build278194846=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I am starting to learn Go.
I follow instruction from https://golang.org/doc/tutorial/getting-started

What did you expect to see?

After running step 4 of the instruction 4 Run your code to see the message generated by the function you're calling I want to see:

$ go run .
go: finding module for package rsc.io/quote
go: found rsc.io/quote in rsc.io/quote v1.5.2
Don't communicate by sharing memory, share memory by communicating.

What did you see instead?

stanislav@vb:~/hello$ nano hello.go 
stanislav@vb:~/hello$ cat hello.go 
package main

import "fmt"

import "rsc.io/quote"

func main() {
    fmt.Println(quote.Go())
}
stanislav@vb:~/hello$ go mod init hello.go
go: creating new go.mod: module hello.go
stanislav@vb:~/hello$ go run .
go: finding module for package rsc.io/quote
go: downloading rsc.io/quote v1.5.2
go: found rsc.io/quote in rsc.io/quote v1.5.2
go: rsc.io/quote@v1.5.2 requires
	rsc.io/sampler@v1.3.0 requires
	golang.org/x/text@v0.0.0-20170915032832-14c0d48ead0c: Get "https://proxy.golang.org/golang.org/x/text/@v/v0.0.0-20170915032832-14c0d48ead0c.mod": read tcp 10.0.2.15:39782->172.217.16.49:443: read: connection reset by peer

And on Windows it is:

C:\Users\Admin\hello>go run .
go: finding module for package rsc.io/quote
go: downloading rsc.io/quote v1.5.2
go: found rsc.io/quote in rsc.io/quote v1.5.2
go: rsc.io/quote@v1.5.2 requires
        rsc.io/sampler@v1.3.0 requires
        golang.org/x/text@v0.0.0-20170915032832-14c0d48ead0c: Get "https://proxy.golang.org/golang.org/x/text/@v/v0.0.0-20170915032832-14c0d48ead0c.mod": read tcp 192.168.1.4:1959->172.217.16.49:443: wsarecv: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

So it does not print the line: Don't communicate by sharing memory, share memory by communicating. as stated in the step 4 of the tutorial.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions