Skip to content

Commit b897770

Browse files
committed
Merge branch 'master' of github.com:air-verse/air into air-verse-master
2 parents 43c9fc2 + 1068416 commit b897770

32 files changed

Lines changed: 946 additions & 364 deletions

.github/workflows/build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ jobs:
1717
uses: actions/checkout@v4
1818
- name: Setup Go
1919
id: go
20-
uses: actions/setup-go@v4
20+
uses: actions/setup-go@v5
2121
with:
22-
go-version-file: 'go.mod'
22+
go-version: ^1.23
2323
- name: Install golangci-lint
2424
uses: golangci/golangci-lint-action@v6
2525
with:
26-
version: latest
26+
version: v1.61
2727
- name: Install dependency
2828
run: if [ $(uname) == "Darwin" ]; then brew install gnu-sed ;fi
2929
- name: Build

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
- name: Check out code
1515
uses: actions/checkout@v4
1616
- name: Setup Go
17-
uses: actions/setup-go@v4
17+
uses: actions/setup-go@v5
1818
with:
19-
go-version-file: 'go.mod'
19+
go-version: ^1.23
2020

2121
- name: Set GOVERSION
2222
run: echo "GOVERSION=$(go version | sed -r 's/go version go(.*)\ .*/\1/')" >> $GITHUB_ENV

.github/workflows/smoke_test_reuse_job.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ jobs:
1616
uses: actions/checkout@v4
1717
- name: Setup Go
1818
id: go
19-
uses: actions/setup-go@v4
19+
uses: actions/setup-go@v5
2020
with:
21-
go-version-file: 'go.mod'
21+
go-version: ^1.23
2222
- name: Install
2323
run: make install
2424
- name: Check rebuild

.github/workflows/smoke_test_reuse_job_windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
id: go
1919
uses: actions/setup-go@v4
2020
with:
21-
go-version-file: 'go.mod'
21+
go-version: ^1.23
2222
- name: Setup Python
2323
uses: actions/setup-python@v5
2424
with:

.golangci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ run:
44
linters:
55
disable-all: true
66
enable:
7+
- copyloopvar # detects places where loop variables are copied
78
- errcheck # Errcheck is a program for checking for unchecked errors in go programs.
89
- gci # Gci controls Go package import order and makes it always deterministic
910
- goimports # checks that goimports was run
@@ -12,5 +13,6 @@ linters:
1213
- revive # configurable linter for Go. Drop-in replacement of golint
1314
- staticcheck # go vet on steroids
1415
- stylecheck # static analysis, finds bugs and performance issues, offers simplifications, and enforces style rules
16+
- testifylint # checks usage of github.com/stretchr/testify
1517
- unconvert # Remove unnecessary type conversions
1618
- unused # Checks Go code for unused constants, variables, functions and types

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ LABEL maintainer="Rick Yu <cosmtrek@gmail.com>"
55
ENV GOPATH /go
66
ENV GO111MODULE on
77

8-
COPY . /go/src/github.com/cosmtrek/air
9-
WORKDIR /go/src/github.com/cosmtrek/air
8+
COPY . /go/src/github.com/air-verse/air
9+
WORKDIR /go/src/github.com/air-verse/air
1010

1111
RUN --mount=type=cache,target=/go/pkg/mod go mod download
1212

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ LDFLAGS += -X "main.airVersion=$(AIRVER)"
44
LDFLAGS += -X "main.goVersion=$(shell go version | sed -r 's/go version go(.*)\ .*/\1/')"
55

66
GO := GO111MODULE=on CGO_ENABLED=0 go
7-
GOLANGCI_LINT_VERSION = v1.60.3
7+
GOLANGCI_LINT_VERSION = v1.61.0
88

99
.PHONY: init
1010
init: install-golangci-lint

README-zh_cn.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Air [![Go](https://github.com/air-verse/air/workflows/Go/badge.svg)](https://github.com/air-verse/air/actions?query=workflow%3AGo+branch%3Amaster) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/dcb95264cc504cad9c2a3d8b0795a7f8)](https://www.codacy.com/gh/air-verse/air/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=air-verse/air&amp;utm_campaign=Badge_Grade) [![Go Report Card](https://goreportcard.com/badge/github.com/air-verse/air)](https://goreportcard.com/report/github.com/air-verse/air) [![codecov](https://codecov.io/gh/air-verse/air/branch/master/graph/badge.svg)](https://codecov.io/gh/air-verse/air)
1+
# Air [![Go](https://github.com/air-verse/air/actions/workflows/release.yml/badge.svg)](https://github.com/air-verse/air/actions?query=workflow%3AGo+branch%3Amaster) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/dcb95264cc504cad9c2a3d8b0795a7f8)](https://www.codacy.com/gh/air-verse/air/dashboard?utm_source=github.com&utm_medium=referral&utm_content=air-verse/air&utm_campaign=Badge_Grade) [![Go Report Card](https://goreportcard.com/badge/github.com/air-verse/air)](https://goreportcard.com/report/github.com/air-verse/air) [![codecov](https://codecov.io/gh/air-verse/air/branch/master/graph/badge.svg)](https://codecov.io/gh/air-verse/air)
22

33
:cloud: 热重载 Go 应用的工具
44

@@ -16,11 +16,11 @@ Air 是为 Go 应用开发设计的另外一个热重载的命令行工具。只
1616

1717
## 特色
1818

19-
* 彩色的日志输出
20-
* 自定义构建或必要的命令
21-
* 支持外部子目录
22-
* 在 Air 启动之后,允许监听新创建的路径
23-
* 更棒的构建过程
19+
- 彩色的日志输出
20+
- 自定义构建或必要的命令
21+
- 支持外部子目录
22+
- 在 Air 启动之后,允许监听新创建的路径
23+
- 更棒的构建过程
2424

2525
### 使用参数覆盖指定配置
2626

@@ -42,7 +42,7 @@ air --build.cmd "go build -o bin/api cmd/run.go" --build.bin "./bin/api" --build
4242

4343
### 使用 `go install` (推荐)
4444

45-
使用 go 1.22 或更高版本:
45+
使用 go 1.23 或更高版本:
4646

4747
```shell
4848
go install github.com/air-verse/air@latest
@@ -60,7 +60,6 @@ curl -sSfL https://raw.githubusercontent.com/air-verse/air/master/install.sh | s
6060
air -v
6161
```
6262

63-
6463
### 使用 [goblin.run](https://goblin.run)
6564

6665
```shell
@@ -122,6 +121,7 @@ AIR_PORT=8080 air -c "config.toml"
122121
```
123122

124123
这将用当前目录替换 `$PWD``$AIR_PORT` 是要发布的端口,而 `$@` 用于接受应用程序本身的参数,例如 `-c`
124+
125125
</details>
126126

127127
## 使用方法
@@ -205,7 +205,7 @@ services:
205205

206206
```Dockerfile
207207
# 选择你想要的版本,>= 1.16
208-
FROM golang:1.22-alpine
208+
FROM golang:1.23-alpine
209209
210210
WORKDIR /app
211211
@@ -259,12 +259,11 @@ export PATH=$PATH:$(go env GOPATH)/bin <---- 请确认这行在您的配置信
259259

260260
### 如何在静态文件更改时自动重新加载浏览器?
261261

262-
263262
请参考 [#512](https://github.com/cosmtrek/air/issues/512).
264263

265-
* 确保你的静态文件在 `include_dir`、`include_ext` 或 `include_file` 中。
266-
* 确保你的 HTML 有一个 `</body>` 标签。
267-
* 通过配置以下内容开启代理:
264+
- 确保你的静态文件在 `include_dir`、`include_ext` 或 `include_file` 中。
265+
- 确保你的 HTML 有一个 `</body>` 标签。
266+
- 通过配置以下内容开启代理:
268267

269268
```toml
270269
[proxy]

README-zh_tw.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# :cloud: Air - Live reload for Go apps
22

3-
[![Go](https://github.com/air-verse/air/actions/workflows/release.yml/badge.svg)](https://github.com/air-verse/air/actions?query=workflow%3AGo+branch%3Amaster) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/dcb95264cc504cad9c2a3d8b0795a7f8)](https://www.codacy.com/gh/air-verse/air/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=air-verse/air&amp;utm_campaign=Badge_Grade) [![Go Report Card](https://goreportcard.com/badge/github.com/air-verse/air)](https://goreportcard.com/report/github.com/air-verse/air) [![codecov](https://codecov.io/gh/air-verse/air/branch/master/graph/badge.svg)](https://codecov.io/gh/air-verse/air)
3+
[![Go](https://github.com/air-verse/air/actions/workflows/release.yml/badge.svg)](https://github.com/air-verse/air/actions?query=workflow%3AGo+branch%3Amaster) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/dcb95264cc504cad9c2a3d8b0795a7f8)](https://www.codacy.com/gh/air-verse/air/dashboard?utm_source=github.com&utm_medium=referral&utm_content=air-verse/air&utm_campaign=Badge_Grade) [![Go Report Card](https://goreportcard.com/badge/github.com/air-verse/air)](https://goreportcard.com/report/github.com/air-verse/air) [![codecov](https://codecov.io/gh/air-verse/air/branch/master/graph/badge.svg)](https://codecov.io/gh/air-verse/air)
44

55
![air](docs/air.png)
66

@@ -16,11 +16,11 @@ Air 是一個另類的自動重新編譯執行命令列工具,用於開發 Go
1616

1717
## 功能列表
1818

19-
* 彩色的日誌輸出
20-
* 自訂建立或任何命令
21-
* 支援排除子目錄
22-
* 允許在 Air 開始後監視新目錄
23-
* 更佳的建置過程
19+
- 彩色的日誌輸出
20+
- 自訂建立或任何命令
21+
- 支援排除子目錄
22+
- 允許在 Air 開始後監視新目錄
23+
- 更佳的建置過程
2424

2525
### 用參數覆寫指定的配置
2626

@@ -42,7 +42,7 @@ air --build.cmd "go build -o bin/api cmd/run.go" --build.bin "./bin/api" --build
4242

4343
### 使用 `go install` (推薦)
4444

45-
需要使用 go 1.22 或更高版本:
45+
需要使用 go 1.23 或更高版本:
4646

4747
```bash
4848
go install github.com/air-verse/air@latest

README.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# :cloud: Air - Live reload for Go apps
22

3-
[![Go](https://github.com/air-verse/air/actions/workflows/release.yml/badge.svg)](https://github.com/air-verse/air/actions?query=workflow%3AGo+branch%3Amaster) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/dcb95264cc504cad9c2a3d8b0795a7f8)](https://www.codacy.com/gh/air-verse/air/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=air-verse/air&amp;utm_campaign=Badge_Grade) [![Go Report Card](https://goreportcard.com/badge/github.com/air-verse/air)](https://goreportcard.com/report/github.com/air-verse/air) [![codecov](https://codecov.io/gh/air-verse/air/branch/master/graph/badge.svg)](https://codecov.io/gh/air-verse/air)
3+
[![Go](https://github.com/air-verse/air/actions/workflows/release.yml/badge.svg)](https://github.com/air-verse/air/actions?query=workflow%3AGo+branch%3Amaster) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/dcb95264cc504cad9c2a3d8b0795a7f8)](https://www.codacy.com/gh/air-verse/air/dashboard?utm_source=github.com&utm_medium=referral&utm_content=air-verse/air&utm_campaign=Badge_Grade) [![Go Report Card](https://goreportcard.com/badge/github.com/air-verse/air)](https://goreportcard.com/report/github.com/air-verse/air) [![codecov](https://codecov.io/gh/air-verse/air/branch/master/graph/badge.svg)](https://codecov.io/gh/air-verse/air)
44

55
![air](docs/air.png)
66

@@ -20,16 +20,26 @@ Note: This tool has nothing to do with hot-deploy for production.
2020

2121
## Features
2222

23-
* Colorful log output
24-
* Customize build or any command
25-
* Support excluding subdirectories
26-
* Allow watching new directories after Air started
27-
* Better building process
23+
- Colorful log output
24+
- Customize build or any command
25+
- Support excluding subdirectories
26+
- Allow watching new directories after Air started
27+
- Better building process
2828

2929
### Overwrite specify configuration from arguments
3030

3131
Support air config fields as arguments:
3232

33+
You can view the available command-line arguments by running the following commands:
34+
35+
```
36+
air -h
37+
```
38+
or
39+
```
40+
air --help
41+
```
42+
3343
If you want to config build command and run command, you can use like the following command without the config file:
3444

3545
```shell
@@ -46,7 +56,7 @@ air --build.cmd "go build -o bin/api cmd/run.go" --build.bin "./bin/api" --build
4656

4757
### Via `go install` (Recommended)
4858

49-
With go 1.22 or higher:
59+
With go 1.23 or higher:
5060

5161
```bash
5262
go install github.com/air-verse/air@latest
@@ -209,7 +219,7 @@ services:
209219

210220
```Dockerfile
211221
# Choose whatever you want, version >= 1.16
212-
FROM golang:1.22-alpine
222+
FROM golang:1.23-alpine
213223
214224
WORKDIR /app
215225
@@ -245,12 +255,12 @@ services:
245255
```shell
246256
export GOPATH=$HOME/xxxxx
247257
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
248-
export PATH=$PATH:$(go env GOPATH)/bin <---- Confirm this line in you profile!!!
258+
export PATH=$PATH:$(go env GOPATH)/bin #Confirm this line in your .profile and make sure to source the .profile if you add it!!!
249259
```
250260

251261
### Error under wsl when ' is included in the bin
252262

253-
Should use `\` to escape the `' in the bin. related issue: [#305](https://github.com/air-verse/air/issues/305)
263+
Should use `\` to escape the `'` in the bin. related issue: [#305](https://github.com/air-verse/air/issues/305)
254264

255265
### Question: how to do hot compile only and do not run anything?
256266

@@ -263,12 +273,11 @@ Should use `\` to escape the `' in the bin. related issue: [#305](https://github
263273

264274
### How to Reload the Browser Automatically on Static File Changes
265275

266-
267276
Refer to issue [#512](https://github.com/air-verse/air/issues/512) for additional details.
268277

269-
* Ensure your static files in `include_dir`, `include_ext`, or `include_file`.
270-
* Ensure your HTML has a `</body>` tag
271-
* Activate the proxy by configuring the following config:
278+
- Ensure your static files in `include_dir`, `include_ext`, or `include_file`.
279+
- Ensure your HTML has a `</body>` tag
280+
- Activate the proxy by configuring the following config:
272281

273282
```toml
274283
[proxy]

0 commit comments

Comments
 (0)