【后端开发】字节跳动青训营Cloudwego脚手架

Cloudwego脚手架使用

cwgo脚手架

  1. 安装的命令:
bash 复制代码
GOPROXY=https://goproxy.cn/,direct go install github.com/cloudwego/cwgo@latest
  1. 依赖thriftgo的安装:
bash 复制代码
go install github.com/cloudwego/thriftgo@latest
  1. 编辑echo.thrift文件用于生成项目:
powershell 复制代码
namespace go api

struct Request {
    1: string message
}

struct Response {
    1: string message //注意这里前面的是数字1不是字母l
}

service Echo {
    Response echo(1: Request req)
}
  1. 在demo/demo_thrift目录下生成代码:
bash 复制代码
cwgo server --type RPC --module github.com/cloudwego/biz-demo/gomall/demo/demo_thrift --service demo_thrift --idl ../../idl/echo.thrift

最后得到如下结果:

相关推荐
源代码•宸16 小时前
Golang基础语法(go语言结构体、go语言数组与切片、go语言条件句、go语言循环)
开发语言·经验分享·后端·算法·golang·go
華勳全栈1 天前
两天开发完成智能体平台
java·spring·go
stark张宇2 天前
Go语言核心三剑客:数组、切片与结构体使用指南
后端·go
Aevget2 天前
智能高效Go开发工具GoLand v2025.3全新上线——新增资源泄漏分析
开发语言·ide·后端·golang·go
wwz163 天前
Dagor —— 一个高性能 DAG 算子执行框架,开箱即用!
go
源代码•宸3 天前
goframe框架签到系统项目开发(补签逻辑实现、编写Lua脚本实现断签提醒功能、简历示例)
数据库·后端·中间件·go·lua·跨域·refreshtoken
光头闪亮亮4 天前
Go语言开发的命令行MP3播放器
go
Grassto4 天前
Go Module 的版本选择算法:Minimal Version Selection(MVS)
后端·golang·go·go module
汪小成4 天前
Go CLI 入口设计:参数解析、错误处理与项目分层实战
后端·go
gitboyzcf5 天前
Go(GoLang)语言基础、知识速查
后端·go