英文:
Why when I move file %GOROOT%\tour.exe to foo\tour.exe , Go tour cannot run?
问题
-
我阅读了https://go.dev/tour/welcome/3。
-
我的环境
Microsoft Windows [版本 10.0.22621.1265]
(c) Microsoft Corporation。保留所有权利。
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>
- 我运行CMD,
go install golang.org/x/website/tour@latest
我有
我运行C:\Users\donhu\go\bin\tour.exe
没问题
为什么当我将文件%GOROOT%\tour.exe
移动到foo\tour.exe
时,Go tour无法运行?
英文:
-
My environment
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>
- I run CMD,
go install golang.org/x/website/tour@latest
I have
I run C:\Users\donhu\go\bin\tour.exe
ok
Why when I move file %GOROOT%\tour.exe
to foo\tour.exe
, Go tour cannot run?
答案1
得分: 0
因为端口3999
已被占用。
http://127.0.0.1:3999/welcome/1
tour.exe
可以在任何文件夹中独立运行。
英文:
Because port 3999
is in use.
http://127.0.0.1:3999/welcome/1
tour.exe
can run standalone at every folder.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论