Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump go to 1.23 #650

Merged
merged 1 commit into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:
uses: actions/checkout@v4
- name: Setup Go
id: go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ^1.22
go-version: ^1.23
- name: Install golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59
version: v1.61
- name: Install dependency
run: if [ $(uname) == "Darwin" ]; then brew install gnu-sed ;fi
- name: Build
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
- name: Check out code
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ^1.22
go-version: ^1.23

- name: Set GOVERSION
run: echo "GOVERSION=$(go version | sed -r 's/go version go(.*)\ .*/\1/')" >> $GITHUB_ENV
Expand Down Expand Up @@ -51,4 +51,4 @@ jobs:
platforms: linux/amd64,linux/arm64
tags: cosmtrek/air:${{ env.VERSION }}
- name: Show docker image digest
run: echo ${{ steps.docker_build.outputs.digest }}
run: echo ${{ steps.docker_build.outputs.digest }}
6 changes: 3 additions & 3 deletions .github/workflows/smoke_test_reuse_job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
uses: actions/checkout@v4
- name: Setup Go
id: go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ^1.22
go-version: ^1.23
- name: Install
run: make install
- name: Check rebuild
Expand All @@ -34,4 +34,4 @@ jobs:
- uses: nick-invision/assert-action@v2
with:
expected: "PASS"
actual: ${{ steps.check_rebuild.outputs.value }}
actual: ${{ steps.check_rebuild.outputs.value }}
2 changes: 1 addition & 1 deletion .github/workflows/smoke_test_reuse_job_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
id: go
uses: actions/setup-go@v4
with:
go-version: ^1.22
go-version: ^1.23
- name: Setup Python
uses: actions/setup-python@v5
with:
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
FROM golang:1.22 AS builder
FROM golang:1.23 AS builder

LABEL maintainer="Rick Yu <[email protected]>"

ENV GOPATH /go
ENV GO111MODULE on

COPY . /go/src/github.com/cosmtrek/air
WORKDIR /go/src/github.com/cosmtrek/air
COPY . /go/src/github.com/air-verse/air
WORKDIR /go/src/github.com/air-verse/air

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

RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build make ci && make install

FROM golang:1.22
FROM golang:1.23

COPY --from=builder /go/bin/air /go/bin/air

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ LDFLAGS += -X "main.airVersion=$(AIRVER)"
LDFLAGS += -X "main.goVersion=$(shell go version | sed -r 's/go version go(.*)\ .*/\1/')"

GO := GO111MODULE=on CGO_ENABLED=0 go
GOLANGCI_LINT_VERSION = v1.56.2
GOLANGCI_LINT_VERSION = v1.61.0

.PHONY: init
init: install-golangci-lint
Expand Down
25 changes: 12 additions & 13 deletions README-zh_cn.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Air [![Go](https:/air-verse/air/workflows/Go/badge.svg)](https:/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)
# Air [![Go](https:/air-verse/air/workflows/Go/badge.svg)](https:/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)

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

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

## 特色

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

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

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

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

使用 go 1.22 或更高版本:
使用 go 1.23 或更高版本:

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


### 使用 [goblin.run](https://goblin.run)

```shell
Expand Down Expand Up @@ -122,6 +121,7 @@ AIR_PORT=8080 air -c "config.toml"
```

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

</details>

## 使用方法
Expand Down Expand Up @@ -205,7 +205,7 @@ services:

```Dockerfile
# 选择你想要的版本,>= 1.16
FROM golang:1.22-alpine
FROM golang:1.23-alpine

WORKDIR /app

Expand Down Expand Up @@ -259,12 +259,11 @@ export PATH=$PATH:$(go env GOPATH)/bin <---- 请确认这行在您的配置信

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


请参考 [#512](https:/cosmtrek/air/issues/512).

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

```toml
[proxy]
Expand Down
14 changes: 7 additions & 7 deletions README-zh_tw.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# :cloud: Air - Live reload for Go apps

[![Go](https:/air-verse/air/actions/workflows/release.yml/badge.svg)](https:/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)
[![Go](https:/air-verse/air/actions/workflows/release.yml/badge.svg)](https:/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)

![air](docs/air.png)

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

## 功能列表

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

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

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

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

需要使用 go 1.22 或更高版本:
需要使用 go 1.23 或更高版本:

```bash
go install github.com/air-verse/air@latest
Expand Down
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# :cloud: Air - Live reload for Go apps

[![Go](https:/air-verse/air/actions/workflows/release.yml/badge.svg)](https:/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)
[![Go](https:/air-verse/air/actions/workflows/release.yml/badge.svg)](https:/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)

![air](docs/air.png)

Expand All @@ -20,11 +20,11 @@ Note: This tool has nothing to do with hot-deploy for production.

## Features

* Colorful log output
* Customize build or any command
* Support excluding subdirectories
* Allow watching new directories after Air started
* Better building process
- Colorful log output
- Customize build or any command
- Support excluding subdirectories
- Allow watching new directories after Air started
- Better building process

### Overwrite specify configuration from arguments

Expand All @@ -46,7 +46,7 @@ air --build.cmd "go build -o bin/api cmd/run.go" --build.bin "./bin/api" --build

### Via `go install` (Recommended)

With go 1.22 or higher:
With go 1.23 or higher:

```bash
go install github.com/air-verse/air@latest
Expand Down Expand Up @@ -209,7 +209,7 @@ services:

```Dockerfile
# Choose whatever you want, version >= 1.16
FROM golang:1.22-alpine
FROM golang:1.23-alpine

WORKDIR /app

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

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


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

* Ensure your static files in `include_dir`, `include_ext`, or `include_file`.
* Ensure your HTML has a `</body>` tag
* Activate the proxy by configuring the following config:
- Ensure your static files in `include_dir`, `include_ext`, or `include_file`.
- Ensure your HTML has a `</body>` tag
- Activate the proxy by configuring the following config:

```toml
[proxy]
Expand Down
40 changes: 25 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,36 +1,46 @@
module github.com/air-verse/air

go 1.22
go 1.23

require (
dario.cat/mergo v1.0.0
github.com/creack/pty v1.1.21
github.com/fatih/color v1.16.0
dario.cat/mergo v1.0.1
github.com/creack/pty v1.1.23
github.com/fatih/color v1.17.0
github.com/fsnotify/fsnotify v1.7.0
github.com/gohugoio/hugo v0.123.3
github.com/gohugoio/hugo v0.134.3
github.com/pelletier/go-toml v1.9.5
github.com/stretchr/testify v1.8.4
github.com/stretchr/testify v1.9.0
)

require (
github.com/bep/debounce v1.2.1 // indirect
github.com/bep/godartsass v1.2.0 // indirect
github.com/bep/godartsass/v2 v2.0.0 // indirect
github.com/bep/golibsass v1.1.1 // indirect
github.com/bep/godartsass/v2 v2.1.0 // indirect
github.com/bep/golibsass v1.2.0 // indirect
github.com/bep/gowebp v0.4.0 // indirect
github.com/bep/lazycache v0.5.0 // indirect
github.com/cli/safeexec v1.0.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dlclark/regexp2 v1.11.4 // indirect
github.com/getkin/kin-openapi v0.127.0 // indirect
github.com/gobuffalo/flect v1.0.3 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/hashstructure v1.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/tdewolff/parse/v2 v2.7.12 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/tdewolff/parse/v2 v2.7.15 // indirect
github.com/tdewolff/test v1.0.11-0.20240106005702-7de5f7df4739 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
golang.org/x/image v0.20.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/tools v0.25.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading