Giter Site home page Giter Site logo

kitex-examples's Introduction

Kitex Examples

English | 中文

How to run

You can go into the related examples for information on "how to run"

Bizdemo

  • bizdemo/kitex_gorm Example of using Kitex and gorm
  • bizdemo/kitex_gorm_gen Example of using Kitex and gorm_gen
  • bizdemo/kitex_zorm Example of using Kitex and zorm
  • bizdemo/kitex_ent Example of using Kitex and ent
  • bizdemo/easy_note Example of using Kitex as an rpc framework to implement a simple note service with multiple middlewares
  • Bookinfo Example of using Kitex as the rpc framework to implement multi-functional book service programs including istio, OpenTelemetry, etc.
  • Open Payment Platform Example of using Kitex as the rpc framework to demonstrate the usage of Kitex generic call, and builds an integrated payment platform.
  • Book Shop Example of using Kitex as an rpc framework to implement an e-commerce system including an ElasticSearch search engine
  • FreeCar Example of using Kitex as the rpc framework to implement cloud native time-sharing car rental system suite services

Basic features

  • basic Basic example of Kitex
  • async_call Example of using asynchronous call in Kitex server
  • codec Example of Kitex server and client using custom codecs
    • codec-Dubbo Example of Dubbo protocol codec launched by Kitex to support Kitex <-> Dubbo interoperability
  • long_connection Kitex example of using long connections between server and client
  • streaming Example of Kitex server and client using streams (based on GRPC/HTTP2, using Protobuf IDL)
  • thrift streaming Example of Kitex server and client using thrift streaming (based on GRPC/HTTP2, using Thrift IDL)
  • business_exception Example of Kitex server and client using business exceptions
  • middleware Kitex Example of using middleware between server and client

Governance Features

  • Example of kitex server using configuration center to connect to governance features
    • etcd Kitex server uses etcd as an example of connecting the configuration center with governance features
    • nacos Kitex server uses nacos as an example of connecting the configuration center with governance features
    • apollo Kitex server uses apollo as an example of connecting the configuration center with governance features
  • discovery Example of Kitex server and client using service registration and discovery
    • etcd Example of Kitex server and client using etcd as service registration center
    • nacos Kitex server and client use nacos as an example of service registration center
    • polaris Kitex server and client use polaris as an example of service registration center
    • zookeeper Example of Kitex server and client using zookeeper as service registration center
    • consul Example of Kitex server and client using consul as service registration center
    • servicecomb Kitex server and client use servicecomb as an example of service registration center
    • eureka Kitex server and client use eureka as an example of service registration center
    • dns Example of Kitex server and client using dns for service discovery
    • resolver_rule_based provides a rule-based resolver for Kitex. It allows users to configure rules in service discovery to filter service instances and implement traffic segmentation.
  • timeout Example of using timeout control between Kitex server and client
  • limit Example of using current limit on Kitex server
  • circuit_breaker Example of Kitex client using circuit breaker
  • retry Example of Kitex client using retry
  • load_balance Example of Kitex server and client using load balancing

Observability

  • opentelemetry Example of Kitex server and client using OpenTelemetry
  • prometheus Example of Kitex server and client using prometheus
  • tracer Example of using tracer on Kitex server and client
  • klog Example of using klog logs on the Kitex server

Advanced features

  • frugal Kitex example of using frugal on the server and client
  • grpc_proxy Example of Kitex server and client using grpc_proxy
  • generic Kitex example of using generic calls between server and client
  • meta_info Example of Kitex server and client using meta information
  • server_hook Examples of customizing business logic before and after Kitex server startup/exit
  • server_sdk Example of Kitex server-side SDKization
  • profiler Example of Kitex server and client performance analysis using request cost metrics
  • proxyless Example of letting Kitex services run in proxyless mode and be managed uniformly by the service mesh
  • grpc_multi_service Example of Kitex server and client using grpc multiservice
  • thrift_multi_service Example of Kitex server and client using thrift (non-streaming) multiservice
  • protobuf_multi_service Example of Kitex server and client using protobuf (non-streaming) multiservice
  • goroutine_local_storage Example of Kitex server and client using goroutine_local_storage

Kitex generated code

  • protobuf Example of using Kitex and protobuf to generate server code
  • template Example of using Kitex custom template to generate server code
  • thrift Example of using Kitex and thrift to generate server code
  • protobuf Example of using Kitex and protobuf to generate server code

Note

All commands to execute the example should be executed under "kitex-examples".

kitex-examples's People

Contributors

ag9920 avatar baiyutang avatar baize1998 avatar coderpoet avatar cold-runner avatar cqqqq777 avatar daidai21 avatar dependabot[bot] avatar felix021 avatar gaozizhong avatar gityh2021 avatar guangmingluo avatar h1deonbush avatar hakusai22 avatar heyjavabean avatar jasonhxiang avatar jathonli avatar joway avatar justlorain avatar kezhenxu94 avatar li-jin-gou avatar marina-sakai avatar mull1on avatar ppzqh avatar purewhitewu avatar rogerogers avatar simon0-o avatar violapioggia avatar weichenxu923 avatar xz0730 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kitex-examples's Issues

请问是否有搭建 easy_note 项目的流程

Is your feature request related to a problem? Please describe.

刚刚了解到了 gorm、kitex、hertz 框架的强大之处,但它们的教程往往是孤立的,只涉及各自的单独使用。我觉得 easy_note 这个项目很适合将这三个框架串起来,但只有 quick start,而没有使用这三个框架逐渐构建出这个项目的教程。

Describe the solution you'd like

希望有这样一个教程:使用 gorm、kitex、hertz 一步一步构建出这个笔记项目,增强自身的一些自信心。

Repository 'https://github.com/cloudwego/kitex-contrib/' not found

An error occurs while I following the quick-start on the step go run .

go: github.com/cloudwego/kitex-contrib/[email protected]: invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /opt/go/pkg/mod/cache/vcs/d2a4a1998dd9cf86d2cb6627756503b46f2d0a457aa31fe3bdec9be7f0670bcd: exit status 128:
        remote: Repository not found.
        fatal: repository 'https://github.com/cloudwego/kitex-contrib/' not found

GORM example shall include the otel configuration. For Log, Provider etc.

Is your feature request related to a problem? Please describe.

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like

A clear and concise description of what you want to happen.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

在本地环境Mac m1下启动Etcd报端口占用,请问怎么解决

{"level":"fatal","ts":"2022-07-27T08:01:16.260Z","caller":"etcdmain/etcd.go:204","msg":"discovery failed","error":"listen tcp 127.0.0.1:2380: bind: address already in use","stacktrace":"go.etcd.io/etcd/server/v3/etcdmain.startEtcdOrProxyV2\n\t/go/src/go.etcd.io/etcd/release/etcd/server/etcdmain/etcd.go:204\ngo.etcd.io/etcd/server/v3/etcdmain.Main\n\t/go/src/go.etcd.io/etcd/release/etcd/server/etcdmain/main.go:40\nmain.main\n\t/go/src/go.etcd.io/etcd/release/etcd/server/main.go:32\nruntime.main\n\t/go/gos/go1.16.15/src/runtime/proc.go:225"}

如何通过kitex命令生成类似bizdemo/easy_note中的目录结构

kitex如何指定生成service的路径,从而类似easy_note中的目录结构一样。使用常规的kitex -service demo demo.thrift只能生成这样的目录结构
.
├── build.sh // 服务的构建脚本,会创建一个名为 output 的目录并生成启动服务所需的文件到里面
├── handler.go // 用户在该文件里实现 IDL service 定义的方法
├── kitex_gen // IDL 内容相关的生成代码
│ ├── base // base.thrift 的生成代码
│ │ ├── base.go // thriftgo 的产物,包含 base.thrift 定义的内容的 go 代码
│ │ └── k-base.go // kitex 在 thriftgo 的产物之外生成的代码
│ └── demo // demo.thrift 的生成代码
│ ├── demo.go // thriftgo 的产物,包含 demo.thrift 定义的内容的 go 代码
│ ├── k-demo.go // kitex 在 thriftgo 的产物之外生成的代码
│ └── demoservice // kitex 为 demo.thrift 里定义的 demo service 生成的代码
│ ├── demoservice.go // 提供了 client.go 和 server.go 共用的一些定义
│ ├── client.go // 提供了 NewClient API
│ └── server.go // 提供了 NewServer API
├── main.go // 程序入口
└── script // 构建脚本
└── bootstrap.sh // 服务的启动脚本,会被 build.sh 拷贝至 output 下

而easy_note中的代码结构中通过kitex生成的script/*、main.go和handler.go与kitex_gen不在同一个目录下,这是怎么做到的,是自己复制的吗,那这样每次都需要自己手动修改handler.go中的包名很麻烦啊

Proposal: Build an API Gateway Based on CloudWeGo Projects

Goal

The primary goal of this proposal is to implement a demo API Gateway on Hertz which accepts HTTP requests encoded in JSON format and uses the Generic-Call feature of Kitex to translate these requests into Thrift binary format requests. The API Gateway will then forward the request to one of the backend RPC servers discovered from the registry center.

Requirements and Deliverables

  1. Implement an API Gateway that accepts HTTP requests with JSON-encoded bodies.
  2. Use the Generic-Call feature in Kitex to translate JSON requests into Thrift binary format.
  3. Integrate a load balancing mechanism to distribute requests among backend RPC servers.
  4. Integrate a service registry and discovery mechanism for the API Gateway and RPC servers.
  5. Develop backend RPC servers using Kitex for testing the API Gateway.
  6. Document the project, including design decisions, implementation details, and usage instructions.

You're encouraged to post your implementation here for others' reference.

Template:

Project Name:
Authors: [feel free to mention your github id, email, school/company, and/or any other information you'd like to provide]
Github: [url]
Documentation: [url]
Description: [brief introduction on your project]

Dose not support go version > 1.19?

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

I tried to run the kitex-example/hello demo, and I followed the quick start doc

Output

# github.com/choleraehyq/pid
../../../Applications/Go/pkg/mod/github.com/choleraehyq/[email protected]/pid_go1.5_amd64.s:44: expected pseudo-register; found R13
../../../Applications/Go/pkg/mod/github.com/choleraehyq/[email protected]/pid_go1.5_amd64.s:45: expected pseudo-register; found R14
asm: assembly of ../../../Applications/Go/pkg/mod/github.com/choleraehyq/[email protected]/pid_go1.5_amd64.s failed
# github.com/cloudwego/frugal/internal/loader
../../../Applications/Go/pkg/mod/github.com/cloudwego/[email protected]/internal/loader/funcdata.go:32:22: undefined: _ModuleData
../../../Applications/Go/pkg/mod/github.com/cloudwego/[email protected]/internal/loader/funcdata.go:35:27: undefined: _ModuleData
../../../Applications/Go/pkg/mod/github.com/cloudwego/[email protected]/internal/loader/funcdata.go:39:16: undefined: _ModuleData
../../../Applications/Go/pkg/mod/github.com/cloudwego/[email protected]/internal/loader/funcdata.go:75:26: undefined: _ModuleData
../../../Applications/Go/pkg/mod/github.com/cloudwego/[email protected]/internal/loader/funcdata_invalid.go:27:9: panic("Unsupported Go version. Supported versions are: 1.15, 1.16, 1.17, 1.18, 1.19") (no value) used as value

Kitex version:

v0.5.1

Environment:

The output of go env.

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/stx5/.cache/go-build"
GOENV="/home/stx5/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/stx5/Applications/Go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/stx5/Applications/Go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/stx5/goproject/kitex-examples/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build2960749202=/tmp/go-build -gno-record-gcc-switches"

Additional context

I am running this demo on wsl2
OS: Ubuntu 20.04 focal(on the Windows Subsystem for Linux)
Kernel: x86_64 Linux 5.10.102.1-microsoft-standard-WSL2

go 1.22 kitex-mux protobuf example build error

did go mod init and go get -u

this is in kitex-benchmark, sorry i posted in "wrong" issue. but possible to resolve here?

ubuntu@ubuntu:~/kitex-benchmark/protobuf/kitex-mux$ go build main.go 
# github.com/cloudwego/kitex/pkg/utils
../../../go/pkg/mod/github.com/cloudwego/[email protected]/pkg/utils/thrift.go:54:54: not enough arguments in call to t.tProt.WriteMessageBegin
	have (string, thrift.TMessageType, int32)
	want (context.Context, string, thrift.TMessageType, int32)
../../../go/pkg/mod/github.com/cloudwego/[email protected]/pkg/utils/thrift.go:57:21: not enough arguments in call to msg.Write
	have (thrift.TProtocol)
	want (context.Context, thrift.TProtocol)
../../../go/pkg/mod/github.com/cloudwego/[email protected]/pkg/utils/thrift.go:60:11: not enough arguments in call to t.tProt.WriteMessageEnd
	have ()
	want (context.Context)
../../../go/pkg/mod/github.com/cloudwego/[email protected]/pkg/utils/thrift.go:74:35: not enough arguments in call to t.tProt.ReadMessageBegin
	have ()
	want (context.Context)
../../../go/pkg/mod/github.com/cloudwego/[email protected]/pkg/utils/thrift.go:79:27: not enough arguments in call to exception.Read
	have (thrift.TProtocol)
	want (context.Context, thrift.TProtocol)
../../../go/pkg/mod/github.com/cloudwego/[email protected]/pkg/utils/thrift.go:82:12: not enough arguments in call to t.tProt.ReadMessageEnd
	have ()
	want (context.Context)
../../../go/pkg/mod/github.com/cloudwego/[email protected]/pkg/utils/thrift.go:88:20: not enough arguments in call to msg.Read
	have (thrift.TProtocol)
	want (context.Context, thrift.TProtocol)
../../../go/pkg/mod/github.com/cloudwego/[email protected]/pkg/utils/thrift.go:91:2: not enough arguments in call to t.tProt.ReadMessageEnd
	have ()
	want (context.Context)
../../../go/pkg/mod/github.com/cloudwego/[email protected]/pkg/utils/thrift.go:100:21: not enough arguments in call to msg.Write
	have (thrift.TProtocol)
	want (context.Context, thrift.TProtocol)
../../../go/pkg/mod/github.com/cloudwego/[email protected]/pkg/utils/thrift.go:114:20: not enough arguments in call to msg.Read
	have (thrift.TProtocol)
	want (context.Context, thrift.TProtocol)
../../../go/pkg/mod/github.com/cloudwego/[email protected]/pkg/utils/thrift.go:114:20: too many errors

[BUG] Error compiling Dockerfile due to low Go version

Describe the bug

根据readme描述,使用dockerfile对项目进行编译的时候,执行到编译项目时报go版本低于1.17无法完成编译
To Reproduce

Steps to reproduce the behavior:

  1. run docker build -t kitex-examples .
  2. see:
#12 86.98 /go/pkg/mod/golang.org/x/[email protected]/unix/syscall.go:83:16: undefined: unsafe.Slice
#12 86.98 /go/pkg/mod/golang.org/x/[email protected]/unix/syscall_linux.go:2271:9: undefined: unsafe.Slice
#12 86.98 /go/pkg/mod/golang.org/x/[email protected]/unix/syscall_unix.go:118:7: undefined: unsafe.Slice
#12 86.98 /go/pkg/mod/golang.org/x/[email protected]/unix/sysvshm_unix.go:33:7: undefined: unsafe.Slice
#12 86.98 note: module requires Go 1.17
------
executor failed running [/bin/sh -c go build -o hello-client ./hello/client]: exit code: 2

Expected behavior
将dockerfile内的镜像版本选为golang:1.18.10-alpine可以编译通过

Screenshots

If applicable, add screenshots to help explain your problem.

Kitex version:

$ kitex --version
v0.5.2

希望提供 Trans 使用 gonet 的示例。

  1. 文档 https://www.cloudwego.io/zh/docs/kitex/tutorials/framework-exten/transport/ 提供了定制传输层的说明,比较抽象,作为框架使用者不知道怎么用。
  2. changelog https://www.cloudwego.io/zh/blog/2022/08/26/kitex-v0.4.0-%E7%89%88%E6%9C%AC%E5%8F%91%E5%B8%83/ 提到 v0.4.0 支持了 gonet 作为传输层,只说在 window 场景作为默认的传输层。但没有说明如何强制指定。

诉求:

  1. https://www.cloudwego.io/zh/docs/kitex/tutorials/framework-exten/transport/ 文档添加如何使用 gonet 配置的示例。
  2. example 代码库添加关于传输层配置的示例,比如,添加一个可运行的 demo, 这个 demo 配置使用 gonet 作为传输层。

more detail introduction in readme

Describe the solution you'd like

Add more detail introduction in readme so that user can have a brief impression about what is this project.

Describe alternatives you've considered

concluse introduction and catalogue about sub-function

求助:easy_note项目在windows下build note报错

`

github.com/cloudwego/netpoll

......\goPath\pkg\mod\github.com\cloudwego\[email protected]\connection.go:59:18: undefined: OnRequest
......\goPath\pkg\mod\github.com\cloudwego\[email protected]\connection_impl.go:30:2: undefined: netFD
......\goPath\pkg\mod\github.com\cloudwego\[email protected]\connection_impl.go:41:19: undefined: barrier
......\goPath\pkg\mod\github.com\cloudwego\[email protected]\connection_impl.go:42:19: undefined: barrier
......\goPath\pkg\mod\github.com\cloudwego\[email protected]\connection_impl.go:48:20: cannot use &connection{} (value of type *connection) as type Connec
tion in variable declaration:
*connection does not implement Connection (missing LocalAddr method)
......\goPath\pkg\mod\github.com\cloudwego\[email protected]\connection_impl.go:299:32: undefined: Conn
......\goPath\pkg\mod\github.com\cloudwego\[email protected]\netpoll_options.go:80:14: undefined: OnPrepare
......\goPath\pkg\mod\github.com\cloudwego\[email protected]\netpoll_options.go:81:14: undefined: OnConnect
......\goPath\pkg\mod\github.com\cloudwego\[email protected]\netpoll_options.go:82:14: undefined: OnRequest
......\goPath\pkg\mod\github.com\cloudwego\[email protected]\netpoll_server.go:37:14: undefined: Listener
......\goPath\pkg\mod\github.com\cloudwego\[email protected]\connection_impl.go:299:32: too many errors

github.com/choleraehyq/pid

......\goPath\pkg\mod\github.com\choleraehyq\[email protected]\pid_go1.5_amd64.s:28: expected pseudo-register; found R13
......\goPath\pkg\mod\github.com\choleraehyq\[email protected]\pid_go1.5_amd64.s:29: expected pseudo-register; found R14
asm: assembly of ......\goPath\pkg\mod\github.com\choleraehyq\[email protected]\pid_go1.5_amd64.s failed

`

otel-collector配置victoriametrics域名不生效

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Kitex version:

Please provide the version of Kitex you are using.

Environment:

The output of go env.

Additional context

Add any other context about the problem here.
使用kitex-examples/opentelemetry,otel-collector配置victoriametrics域名不生效,导致metrics没有指标数据

能不能提供一个完整的Example

能不能提供一个稍微完整点的示例项目呀、也更方便没接触过的人快速熟悉kitex呀。比如一个包含 鉴权、用户、文章三个模块的小示例。

链路报错

报错信息如下:

2021/10/19 18:44:38.967049 tracer.go:70: [Warn] Panic happened during tracer call. This doesn't affect the rpc call, but may lead to lack of monitor data such as metrics and logs: runtime error: invalid memory address or nil pointer dereference, goroutine 28 [running]:
runtime/debug.Stack(0xc0001a3880, 0x176ca60, 0x1d13d40)
/usr/local/opt/go/libexec/src/runtime/debug/stack.go:24 +0x9f
github.com/cloudwego/kitex/internal/stats.(*Controller).tryRecover(0xc000137710, 0x1921198, 0x1d26e48)
/Users/ellipsis/Apps/hhz_go/passport-kitex/vendor/github.com/cloudwego/kitex/internal/stats/tracer.go:70 +0x5b
panic(0x176ca60, 0x1d13d40)
/usr/local/opt/go/libexec/src/runtime/panic.go:965 +0x1b9
github.com/kitex-contrib/tracer-opentracing.(*commonTracer).newCommonSpan(0xc000137740, 0x1924400, 0xc0004147e0, 0x1921238, 0xc0004122a0)
/Users/ellipsis/Apps/hhz_go/passport-kitex/vendor/github.com/kitex-contrib/tracer-opentracing/opentracing.go:33 +0x111
github.com/kitex-contrib/tracer-opentracing.(*serverTracer).Finish(0xc000137740, 0x191c9c0, 0xc000418b10)
/Users/ellipsis/Apps/hhz_go/passport-kitex/vendor/github.com/kitex-contrib/tracer-opentracing/server.go:54 +0x16e
github.com/cloudwego/kitex/internal/stats.(*Controller).DoFinish(0xc000137710, 0x191c9c0, 0xc000418b10, 0x191e998, 0xc000422960, 0x0, 0x0, 0x1921198, 0x1d26e48)
/Users/ellipsis/Apps/hhz_go/passport-kitex/vendor/github.com/cloudwego/kitex/internal/stats/tracer.go:60 +0x130
github.com/cloudwego/kitex/pkg/remote/trans/nphttp2.(*svrTransHandler).finishTracer(0xc000418600, 0x191c9c0, 0xc000418b10, 0x191e998, 0xc000422960, 0x0, 0x0, 0x0, 0x0)
/Users/ellipsis/Apps/hhz_go/passport-kitex/vendor/github.com/cloudwego/kitex/pkg/remote/trans/nphttp2/server_handler.go:204 +0x105
github.com/cloudwego/kitex/pkg/remote/trans/nphttp2.(*svrTransHandler).OnRead.func1.1.1(0x9740008, 0xc00058e000, 0xc000418600, 0x191c9c0, 0xc000418b10, 0x191e998, 0xc000422960, 0x0, 0x0)
/Users/ellipsis/Apps/hhz_go/passport-kitex/vendor/github.com/cloudwego/kitex/pkg/remote/trans/nphttp2/server_handler.go:118 +0x248
github.com/cloudwego/kitex/pkg/remote/trans/nphttp2.(*svrTransHandler).OnRead.func1.1()
/Users/ellipsis/Apps/hhz_go/passport-kitex/vendor/github.com/cloudwego/kitex/pkg/remote/trans/nphttp2/server_handler.go:149 +0x7bc
github.com/bytedance/gopkg/util/gopool.(*worker).run.func1.1(0xc00013ace0, 0xc00041c940)
/Users/ellipsis/Apps/hhz_go/passport-kitex/vendor/github.com/bytedance/gopkg/util/gopool/worker.go:68 +0x62
github.com/bytedance/gopkg/util/gopool.(*worker).run.func1(0xc00013ace0)
/Users/ellipsis/Apps/hhz_go/passport-kitex/vendor/github.com/bytedance/gopkg/util/gopool/worker.go:69 +0xd2
created by github.com/bytedance/gopkg/util/gopool.(*worker).run
/Users/ellipsis/Apps/hhz_go/passport-kitex/vendor/github.com/bytedance/gopkg/util/gopool/worker.go:41 +0x3f

代码如下:
image
image

Can't compile KiteX examples code with Go 1.20

Describe the bug

Can't compile KiteX examples code with Go 1.20

Details: I followed the instructions https://www.cloudwego.io/docs/kitex/getting-started/. When trying to compile the hello server & client code, I got the error from another package's go version check:

panic("Unsupported Go version. Supported versions are: 1.15, 1.16, 1.17, 1.18, 1.19") (no value) used as value

To Reproduce

  1. Install Go environment 1.20.
  2. cd kitex-examples/basic/server && go run .

Expected behavior

Server code runs.

Screenshots

image

Kitex version:

Repo: https://github.com/cloudwego/kitex-examples.git
Branch: main
SHA: 4331b96

Environment:

package main

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/foo/Library/Caches/go-build"
GOENV="/Users/foo/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/foo/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/foo/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.20"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/foo/fooWorkspace/goKitexExamples/kitex-examples/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/h2/qd6vtkhn59dd5yzk3s4w0mbm0000gn/T/go-build3190407640=/tmp/go-build -gno-record-gcc-switches -fno-common"

Additional context
N/A

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.