Comments (9)
g后面的内容具体是什么?是用master最新版本的代码build的turbo命令吗?
生成的格式是 g "{{.PkgPath}}/gen/proto"
, “PkgPath”在你这个case里就是“package/Service”。
另外package path建议都是小写字母。
from turbo.
from turbo.
是什么样的绝对路径?方便把那一行的内容给我看下吗?
from turbo.
from turbo.
虽然可以复现,但因为我不是在Windows下开发的,所以并不知道你是如何复现的。
反馈问题时,还是希望尽量描述清楚,问题是什么,现象是什么,如何复现,运行环境是什么,最好加上日志之类的数据。
谢谢。
from turbo.
from turbo.
1,generate命令没有-p参数,可能是你的笔误。
2,package name 请不要使用大写字母:They are lower case, with no under_scores or mixedCaps.。修改package name时,别忘了同时修改service.yaml中的“package_path”。
3,所以我还是不知道你的grpcswitcher.go 文件中,g那一行的内容到底是什么,如果是g "Order/gen/proto"
,那么至少生成代码是没有问题的,就像你代码里其他地方会用到“Order/grpcservice/impl”这个package一样。试试把“Order”改成“order”,再把两个环境变量“GOPATH”和“GOROOT”删掉?
from turbo.
默认情况下:使用命令:
turbo create order Order -r grpc -p ~/Desktop
生成的代码没问题。
但是修改了 proto的定义文件后,使用如下命令:
turbo generate order -r grpc -I ~/Desktop/order
然后生成的 grpcswitcher.go
文件的第五行是绝对路径:
import (
g "/Users/josin/Desktop/order/gen/proto"
"github.com/vaporz/turbo"
"net/http"
"errors"
)
而不是
import (
g "order/gen/proto"
"github.com/vaporz/turbo"
"net/http"
"errors"
)
from turbo.
明白了,我尝试在本地(Ubuntu)用下面两个命令复现问题,但没发现异常:
turbo create order Order -r grpc -p /mnt/d/workspace
turbo generate order -r grpc -I /mnt/d/workspace/order/
出问题的那行是在generator.go的模板文件中生成的:
Line 92 in fd284c9
能否麻烦您:
1, 修改本地的turbo代码,把g.PkgPath的值打印出来:fmt.Println(g.PkgPath)
2, 运行
cd turbo/turbo
go install
安装修改后的turbo命令。
3,再次执行turbo generate order -r grpc -I ~/Desktop/order
,然后观察打印出来的值
from turbo.
Related Issues (20)
- support swagger HOT 3
- Add LICENSE header for each file HOT 4
- installation issue. HOT 7
- Start service issue. HOT 1
- Support non-RPC requests
- Add an UI for config file
- Replace glide with dep HOT 1
- type error: run demo usage. HOT 1
- Compiling error in generated code if there're multiple services defined in proto file HOT 1
- Does turbo support gRPC services implemented in other languages? HOT 5
- 按照文档增加拦截器提示component不存在,请问是什么原因呢 HOT 3
- go-module surport HOT 3
- turbo create at windows error HOT 4
- win10 turbo create error HOT 2
- Remove GOPATH dependency HOT 1
- How to use map<string, string> in MethodNameRequest? HOT 2
- 服务之间调用的问题 HOT 1
- window下 turbo命令无法使用 HOT 4
- java grpc可以吗? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from turbo.