Comments (3)
@kaisawind Hi, I can not reproduce the problem ,could you show some details:
- go version;
- go env;
- the command for installing the kit;
- the command for creating the service ;
- the detail of your service file;
thanks:)
from kit.
- go info
# go version
go version go1.14.5 linux/amd64
# go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/pana/.cache/go-build"
GOENV="/home/pana/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY="dev.yunxing.tech,github.com/kaisawind"
GONOSUMDB="dev.yunxing.tech,github.com/kaisawind"
GOOS="linux"
GOPATH="/home/pana/go"
GOPRIVATE="dev.yunxing.tech,github.com/kaisawind"
GOPROXY="https://goproxy.io,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build973303776=/tmp/go-build -gno-record-gcc-switches"
- install kit
git clone https://github.com/GrantZheng/kit.git
cd kit
go install
- create service
kit n s -b /home/pana/go/src/github.com/kaisawind/iotx -m github.com/kaisawind/iotx/device
# change service file(Add ping api)
kit g s device # ok
kit g s device --dmw # error happend
kit g s device -t grpc # ok
kit g c device # ok
- service file
package service
import "context"
// DeviceService describes the service.
type DeviceService interface {
// Add your methods here
Ping(ctx context.Context, s string) (rs string, err error)
}
type basicDeviceService struct{}
func (b *basicDeviceService) Ping(ctx context.Context, s string) (rs string, err error) {
// TODO implement the business logic of Ping
return rs, err
}
// NewBasicDeviceService returns a naive, stateless implementation of DeviceService.
func NewBasicDeviceService() DeviceService {
return &basicDeviceService{}
}
// New returns a DeviceService with all of the expected middleware wired in.
func New(middleware []Middleware) DeviceService {
var svc DeviceService = NewBasicDeviceService()
for _, m := range middleware {
svc = m(svc)
}
return svc
}
from kit.
- go info
# go version go version go1.14.5 linux/amd64 # go env GO111MODULE="on" GOARCH="amd64" GOBIN="" GOCACHE="/home/pana/.cache/go-build" GOENV="/home/pana/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GONOPROXY="dev.yunxing.tech,github.com/kaisawind" GONOSUMDB="dev.yunxing.tech,github.com/kaisawind" GOOS="linux" GOPATH="/home/pana/go" GOPRIVATE="dev.yunxing.tech,github.com/kaisawind" GOPROXY="https://goproxy.io,direct" GOROOT="/usr/lib/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/dev/null" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build973303776=/tmp/go-build -gno-record-gcc-switches"
- install kit
git clone https://github.com/GrantZheng/kit.git cd kit go install
- create service
kit n s -b /home/pana/go/src/github.com/kaisawind/iotx -m github.com/kaisawind/iotx/device # change service file(Add ping api) kit g s device # ok kit g s device --dmw # error happend kit g s device -t grpc # ok kit g c device # ok
- service file
package service import "context" // DeviceService describes the service. type DeviceService interface { // Add your methods here Ping(ctx context.Context, s string) (rs string, err error) } type basicDeviceService struct{} func (b *basicDeviceService) Ping(ctx context.Context, s string) (rs string, err error) { // TODO implement the business logic of Ping return rs, err } // NewBasicDeviceService returns a naive, stateless implementation of DeviceService. func NewBasicDeviceService() DeviceService { return &basicDeviceService{} } // New returns a DeviceService with all of the expected middleware wired in. func New(middleware []Middleware) DeviceService { var svc DeviceService = NewBasicDeviceService() for _, m := range middleware { svc = m(svc) } return svc }
Thank you for providing me information. I can reproduce the case, and you could use it without -b flag first. I will fix it as soon as possible. :)
from kit.
Related Issues (20)
- A typo HOT 1
- Could kit allow to specify the path of the pb directory? HOT 5
- Why not encode/decode endpoint req&rsp as a pointer type? HOT 3
- real life files structure HOT 3
- Does the tool require an operating system? HOT 3
- Incorect import when using go modules with full project name HOT 2
- ERRO[0000] exit status 1 HOT 4
- ERRO[0000] exit status 1 HOT 20
- what does stringArray mean? HOT 4
- New a service with snake case name inccluding - but output is _ HOT 1
- choose a protoc-gen-go version HOT 1
- translate README.md to Chinese
- hello, there are some bugs when I used "kit g s hello --dmw" command. HOT 7
- 将文章移至项目内维护 HOT 3
- I am new to go and would like to understand what the _gen files are for?
- Crashed when running command "docker-compose up" HOT 2
- Issue for creating one gRPC service as client for other gRPC service
- how to use http get method in http/handler
- command not found: kit HOT 1
- Add support to generate from .proto only
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 kit.