卓越飞翔博客卓越飞翔博客

卓越飞翔 - 您值得收藏的技术分享站
技术文章34199本站已运行391

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

为什么当我将文件 %goroot%tour.exe 移动到 footour.exe 时,gotour 无法运行?

问题内容

  1. 我阅读了 https://go.dev/tour/welcome/3

  2. 我的环境

microsoft windows [version 10.0.22621.1265]
(c) microsoft corporation. all rights reserved.

c:usersdonhu>go env
set go111module=
set goarch=amd64
set gobin=
set gocache=c:usersdonhuappdatalocalgo-build
set goenv=c:usersdonhuappdataroaminggoenv
set goexe=.exe
set goexperiment=
set goflags=
set gohostarch=amd64
set gohostos=windows
set goinsecure=
set gomodcache=c:usersdonhugopkgmod
set gonoproxy=
set gonosumdb=
set goos=windows
set gopath=c:usersdonhugo
set goprivate=
set goproxy=https://proxy.golang.org,direct
set goroot=c:program filesgo
set gosumdb=sum.golang.org
set gotmpdir=
set gotooldir=c:program filesgopkgtoolwindows_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:usersdonhuappdatalocaltempgo-build1095406662=/tmp/go-build -gno-record-gcc-switches

c:usersdonhu>
  • 我运行 cmd,
  • go install golang.org/x/website/tour@latest

    我有

    我运行 c:usersdonhugobintour.exe ok

    为什么当我将文件 %goroot%tour.exe 移动到 footour.exe 时,gotour 无法运行?


    正确答案


    因为端口3999正在使用中。

    https://www.php.cn/link/c0a3eab00393c89313e8109bb6504a68

    tour.exe 可以在每个文件夹中独立运行。

    卓越飞翔博客
    上一篇: 为什么使用 Golang Mongo 驱动程序执行一个简单的查询需要花费 2 秒以上的时间?
    下一篇: 返回列表
    留言与评论(共有 0 条评论)
       
    验证码:
    隐藏边栏