go

    -5熱度

    1回答

    我在GitHub下有一個項目,我在本地機器上工作。 下面是該項目 .weather: - weather-service.go - darksky-provider.go .grpc-weather: - weather.proto server.go 的server.go文件按以下步驟進行的結構: import ( pb "github.com/sc

    0熱度

    2回答

    我使用go項目go-git作爲git-client,並想從通過gitea託管的私有git存儲庫中獲取。 執行此操作的相應功能是func (r *Remote) Fetch(o *FetchOptions) error,它需要transport.AuthMethod對象進行身份驗證。 我試過如下: repo, _ := git.PlainOpen("/path/to/project/folder")

    -4熱度

    1回答

    我還沒有定義標誌-h也不是--help。 但是用以下代碼,使用標誌-h 不輸出-h未定義的事實 ...爲什麼? 的代碼: package main import ( "flag" "fmt" ) func showHelp() { fmt.Println(` Usage: CLI Template [OPTIONS] Options:

    -2熱度

    2回答

    我是新來的,試圖讓下面一段代碼無法運行。看起來我沒有正確編碼結構的結構部分。幫幫我! package main import ( "encoding/xml" "fmt" "os" ) func main() { type Person struct { Email string `xml:"email"` Phone st

    2熱度

    1回答

    我在檢測應用程序二進制文件時遇到了一些麻煩。 例如,我的項目被稱爲GoServer它位於$GOPATH/src/GoServer和二進制文件(這是由在項目目錄中運行go install創建)位於$GOPATH/bin/ 現在,如果我嘗試在本地運行的情況下使用go run main.go它工作得很好。如果我使用Heroku Local工具包(heroku local)在本地運行它,它也可以正常工作。

    0熱度

    1回答

    我按照以下步驟安裝了用於Go的tensorflow,沒有錯誤信息顯示。 TF_TYPE="cpu" # Change to "gpu" for GPU support TARGET_DIRECTORY='/usr/local' curl -L \ "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflo

    2熱度

    1回答

    我導入了一個軟件包「gopkg.in/yaml.v2」。 這是根據目錄結構 src/ gopkg.in/ yaml.v2 main.go abc.go abc_test.go 當我在編譯時間運行命令go test -v ./...從進口包gopkg.in/yaml.v2其運行單元測試爲好。在我的情況下不需要。 我是Go和它的測試框架的新手。在谷

    2熱度

    1回答

    想象有一個User包,其中只包含兩個簡單的方法 Hello它說「你好」 Say它實現了用戶如何說話 原創 package user import "fmt" type user struct {} func (u user) Hello() { u.Say("Hello") } func (u user) Say(sentence string) { fmt.

    0熱度

    1回答

    我正在通過https連接到url。 client.Get(url) 我可以得到用於驗證服務器證書的根證書嗎? 我看着crypto/tls包 PeerCertificates []*x509.Certificate // certificate chain presented by remote peer VerifiedChains [][]*x509.Certificate //

    2熱度

    3回答

    ,我發現像這樣的代碼: // first returns the first address which satisfies strategy, or if // none do, then the first address of any kind. func (addrs addrList) first(strategy func(Addr) bool) Addr { for _