当前位置: 首页 > news >正文

goctl常用命令

goctl常用命令

help

goctl api--help

输出如下

Generate api related files Usage: goctl api [flags] goctl api [command] Available Commands: dart Generate dart files for provided api in api file doc Generate doc files format Format api files go Generate go files for provided api in api file kt Generate kotlin code for provided api file new Fast create api service plugin Custom file generator swagger Generate swagger file from api ts Generate ts files for provided api in api file validate Validate api file Flags: --branch string The branch of the remote repo, it does work with --remote -h, --help help for api --home string The goctl home path of the template, --home and --remote cannot be set at the same time, if they are, --remote has higher priority --o string Output a sample api file --remote string The remote git repo of the template, --home and --remote cannot be set at the same time, if they are, --remote has higher priority The git repo directory must be consistent with the https://github.com/zeromicro/go-zero-template directory structure Use "goctl api [command] --help" for more information about a command.

goctl api new 快速创建api服务(切记)

goctl api new firstdemo

goctl api format 格式化api文件

goctl apiformat--dir.

goctl api go 为api文件生成go代码(切记)

goctl api go--apifirstdemo.api--dir.

goctl api doc生成doc文档

goctl api doc--dir.--o./doc

goctl api dart/goctl api ts 生成调用文件

goctl api dartgoctl api ts命令主要用于根据你定义的api文件,自动生成客户端请求代码,这样能显著提升前端或者客户端与你的go-zero后端联调的效率

goctl api dart--apifirstdemo.api--dir./dart
goctl api ts--apifirstdemo.api--dir./ts

goctl api swagger

为go-zero定义的api文件生成swagger文档

goctl api swagger--apifirstdemo.api--dir./doc--filenamefirstdemo

go常用命令

go env查看go的环境变量

其中gopath是go插件的安装目录

goenv

安装fresh实现热加载

# 使用这个可以热加载goinstallgithub.com/gravityblast/fresh@latest# 使用安装fresh
http://www.cnnetsun.cn/news/3438488.html

相关文章:

  • Claude人机协同开发工作流:从需求到交付的四步闭环
  • 500+实战题库:LinkedIn IT运维技能深度解析与系统提升指南
  • 企业级数据可视化平台:Metabase架构设计与深度集成实战指南
  • 硬件工程师八大细分方向:从数字电路到射频设计的职业指南
  • 通义灵码不是代码生成器,而是开发者认知外延接口
  • Go03-基础语法与数据类型
  • Go05-函数与方法
  • 栈的C/C++实现:从数组到链表的三种经典结构
  • 如何应用 -中国多时期土地利用数据 CNLUCC|1980-2025|1km全国土地利用/土地覆盖栅格数据
  • 公考培训AI大模型横评:三家头部机构的技术底色差异有多大
  • 电解电容选型五大核心参数与工程实践
  • 小白程序员必看!收藏这份RAG技术指南,轻松玩转大模型知识增强检索
  • 突破分布式游戏服务器通信瓶颈:ET框架Actor模型的深度架构设计与性能优化实践
  • Phaser框架终极指南:3分钟快速掌握HTML5游戏开发
  • Ascend C关键分形格式详解
  • 图解软件开发:从需求到实现的四大核心建模图(用例图、类图、时序图、ER图)
  • 2026 国产 ** 制造 EDA(晶圆工艺 EDA)产业现状 + 企业人才缺口深度解析
  • Jenkins参数化构建Unity多平台自动化打包实战指南
  • 多租户SaaS架构下的BI数据隔离与权限治理体系
  • 3步终极指南:让老旧Mac免费升级到最新macOS系统的完整方案
  • yuque-hexo常见问题解答:解决同步过程中的9大痛点
  • codes外网访问实战:frp穿透8091端口与HTTPS全链路部署
  • pass-js API参考:模板、通行证与字段操作的10个实用方法
  • CANN/Ascend C SIMD浮点转整型
  • 【单片机毕业设计】基于 STM32 的带温度补偿超声波测距报警系统设计,基于 STM32 单片机的可调阈值超声波防撞预警装置开发(014202)
  • 【单片机毕业设计】基于 STM32/51 单片机的公交 GPS 自动语音报站系统设计与实现,基于 STM32/51 单片机的车载手动与自动双模语音报站装置设计(014602)
  • JAMstack CMS核心功能解析:认证授权、数据库与动态管理面板全攻略
  • 头歌 实战入门 - 分布式版本控制核心操作
  • 传感器核心参数实战解析:从理论带宽到工程精度
  • Deep-Live-Cam终极指南:3步实现专业级实时AI换脸