草庐IT

packaged

全部标签

go - Go 中的 Protocol Buffer : cannot find package

我正在关注ProtocolBufferforGotutorial但我有以下问题:我创建地址簿原型(prototype)定义syntax="proto3";packagetutorial;messagePerson{stringname=1;...}我成功运行了编译器并生成了go代码我尝试导入pb包但失败了这正是发生的事情:我将--go_out指定为与​​我的原型(prototype)定义相同:(protoc--go_out=.addressbook.proto)然后在同一个文件夹中,我用这些简单的行创建了一个test.go:packagemainimport"tutorial"但是go

go - Go 中的 Protocol Buffer : cannot find package

我正在关注ProtocolBufferforGotutorial但我有以下问题:我创建地址簿原型(prototype)定义syntax="proto3";packagetutorial;messagePerson{stringname=1;...}我成功运行了编译器并生成了go代码我尝试导入pb包但失败了这正是发生的事情:我将--go_out指定为与​​我的原型(prototype)定义相同:(protoc--go_out=.addressbook.proto)然后在同一个文件夹中,我用这些简单的行创建了一个test.go:packagemainimport"tutorial"但是go

go get thrift package 失败,未找到 repo

遵循储蓄机构的指示golanghomepage:尝试运行gogetthrift包:去获取git.apache.org/thrift.git/lib/go/thrift/...出现以下错误:```#cd.;gitclonehttps://git.apache.org/thrift.gitgodep/src/git.apache.org/thrift.gitCloninginto'godep/src/git.apache.org/thrift.git'...fatal:repository'https://git.apache.org/thrift.git/'notfoundpackage

go get thrift package 失败,未找到 repo

遵循储蓄机构的指示golanghomepage:尝试运行gogetthrift包:去获取git.apache.org/thrift.git/lib/go/thrift/...出现以下错误:```#cd.;gitclonehttps://git.apache.org/thrift.gitgodep/src/git.apache.org/thrift.gitCloninginto'godep/src/git.apache.org/thrift.git'...fatal:repository'https://git.apache.org/thrift.git/'notfoundpackage

Go语言: Using package name inside package scope (for Examples)

我目前正在我的Go测试脚本中编写ExampleFuncs。例如:packagehelloimport"testing"funcExampleGetSymbol(){data:=GetSymbol("AAPL")fmt.Println(len(data.Data))//Output:21}现在,这给了我两个好处:这个例子是在我运行gotest和时执行的它出现在funcGetSymbol下的godoc文档中有一件事困扰着我,我想知道我是否应该做些什么。对于试图从此示例中学习的用户,行data:=GetSymbol("AAPL")实际上应该是data:=hello.GetSymbol("AA

Go语言: Using package name inside package scope (for Examples)

我目前正在我的Go测试脚本中编写ExampleFuncs。例如:packagehelloimport"testing"funcExampleGetSymbol(){data:=GetSymbol("AAPL")fmt.Println(len(data.Data))//Output:21}现在,这给了我两个好处:这个例子是在我运行gotest和时执行的它出现在funcGetSymbol下的godoc文档中有一件事困扰着我,我想知道我是否应该做些什么。对于试图从此示例中学习的用户,行data:=GetSymbol("AAPL")实际上应该是data:=hello.GetSymbol("AA

import - 去 + revel : How to import custom package?

我正在关注涵盖的聊天室教程here我将其更改为导入本地包,而不是使用ravel的github中的示例。我在其中一个Controller中将其更改为类似这样的内容(refresh.gointhetuts):import("./../chatroom""github.com/revel/revel")聊天室位于正确的目录中:-app-chatroom-chatroom.go-controllers-refresh.go-app.gopackagechatroom也已在chatroom.go中初始化。但是在运行代码时,我收到了这个错误:Go代码app/tmp/main.go编译不通过:loc

import - 去 + revel : How to import custom package?

我正在关注涵盖的聊天室教程here我将其更改为导入本地包,而不是使用ravel的github中的示例。我在其中一个Controller中将其更改为类似这样的内容(refresh.gointhetuts):import("./../chatroom""github.com/revel/revel")聊天室位于正确的目录中:-app-chatroom-chatroom.go-controllers-refresh.go-app.gopackagechatroom也已在chatroom.go中初始化。但是在运行代码时,我收到了这个错误:Go代码app/tmp/main.go编译不通过:loc

heroku - 将 go web 应用程序部署到 heroku : can't find package issue

我正在关注thistutorial并尝试将基本的Go网络应用程序部署到Heroku,但在解决错误时遇到困难:远程:----->运行:godepgoinstall-tagsheroku./...远程:main.go:7:3:在以下任何一个中都找不到包“github.com/russross/blackfriday”:远程:/app/tmp/cache/go1.3.3/go/src/pkg/github.com/russross/blackfriday(来自$GOROOT)远程:/tmp/build_1a204a91c152b49fe234bde14529ad27/.heroku/g/sr

heroku - 将 go web 应用程序部署到 heroku : can't find package issue

我正在关注thistutorial并尝试将基本的Go网络应用程序部署到Heroku,但在解决错误时遇到困难:远程:----->运行:godepgoinstall-tagsheroku./...远程:main.go:7:3:在以下任何一个中都找不到包“github.com/russross/blackfriday”:远程:/app/tmp/cache/go1.3.3/go/src/pkg/github.com/russross/blackfriday(来自$GOROOT)远程:/tmp/build_1a204a91c152b49fe234bde14529ad27/.heroku/g/sr