为什么当我将文件%GOROOT%\tour.exe移动到foo\tour.exe时,Go tour无法运行?

tzdcorbm  于 2023-03-06  发布在  Go
关注(0)|答案(1)|浏览(107)

1.我读了https://go.dev/tour/welcome/3
1.我的环境

Microsoft Windows [Version 10.0.22621.1265]
(c) Microsoft Corporation. All rights reserved.

C:\Users\donhu>go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\donhu\AppData\Local\go-build
set GOENV=C:\Users\donhu\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\donhu\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\donhu\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.20.1
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=NUL
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=C:\Users\donhu\AppData\Local\Temp\go-build1095406662=/tmp/go-build -gno-record-gcc-switches

C:\Users\donhu>

1.我负责CMD,

go install golang.org/x/website/tour@latest

我有

我运行C:\Users\donhu\go\bin\tour.exe正常

为什么当我将文件%GOROOT%\tour.exe移动到foo\tour.exe时,Go tour无法运行?

dy2hfwbg

dy2hfwbg1#

因为端口3999正在使用。
http://127.0.0.1:3999/welcome/1
tour.exe可以在每个文件夹中独立运行。

相关问题