首頁 > 後端開發 > Golang > 主體

為什麼當我將檔案 %GOROOT%\tour.exe 移到 foo\tour.exe 時,Gotour 無法運作?

WBOY
發布: 2024-02-06 09:30:04
轉載
864 人瀏覽過

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

問題內容

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

  2. 我的環境

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>
登入後複製
  • 我運行 cmd,
  • go install golang.org/x/website/tour@latest
    登入後複製

    我有

    我運行 c:\users\donhu\go\bin\tour.exe ok

    #

    為什麼當我將檔案 %goroot%\tour.exe 移到 foo\tour.exe 時,gotour 無法運作?


    正確答案


    因為連接埠3999正在使用中。

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

    tour.exe 可以在每個資料夾中獨立運作。

    以上是為什麼當我將檔案 %GOROOT%\tour.exe 移到 foo\tour.exe 時,Gotour 無法運作?的詳細內容。更多資訊請關注PHP中文網其他相關文章!

    來源:stackoverflow.com
    本網站聲明
    本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
    熱門教學
    更多>
    最新下載
    更多>
    網站特效
    網站源碼
    網站素材
    前端模板
    關於我們 免責聲明 Sitemap
    PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!