go 配置热更新

go 配置热更新

  • 在终端中执行
bash 复制代码
go install github.com/air-verse/air@latest
  • 验证是否安装成功
bash 复制代码
air -v
  • 应输出类似:
bash 复制代码
  __    _   ___  
 / /\  | | | |_) 
/_/--\ |_| |_| \_ v1.62.0, built with Go go1.24.1
  • 进入你的 Go 项目根目录 (包含 go.mod 的目录),运行
bash 复制代码
air init

这将生成 .air.toml 配置文件。

  • 配置 GoLand Run Configuration
  1. 点击顶部菜单:Run → Edit Configurations...
  2. 点击 + → 选择 Shell Script
  3. 配置如下:
    • Name : Run with Air
    • Script : air
    • Working directory : 你的项目根目录(如 C:\your\project
  4. 点击 OK

之后你可以通过点击 ▶️ 按钮启动 Air。

相关推荐
Json____1 小时前
springboot开发高校选课管理系统:从零构建前后端分离的全栈实践
java·spring boot·后端·毕业设计·毕设·wwwoop.com
站大爷IP1 小时前
Python的列表推导式把我写崩了,原来圆括号和方括号不是一回事
后端
梦在远山后2 小时前
Python 中字符串常用写法
人工智能·后端
IT_Octopus2 小时前
JSON 日志里的 `{“$ref“:“$.xxx“}`:从 fastjson 兼容包到原生 fastjson2 的迁移实录
开发语言·python·json
geovindu2 小时前
python:HandWriting Recognition using paddlepaddle
开发语言·后端·python·paddlepaddle
步行cgn2 小时前
为何以继承方式引入SpringBoot
java·spring boot·后端
Mr_hou2 小时前
左手.NET右手Node:一个后端开发的双修之路
后端
wuyk5552 小时前
Python 零基础入门第九章:用户输入与 While 循环
开发语言·python
wno7042 小时前
Spring Boot配合Hibernate Validator参数校验
spring boot·后端·hibernate
兮动人2 小时前
Python变量与常量
开发语言·python·机器学习·python变量与常量