Skip to content

Commit 744a58e

Browse files
authored
Drop support for go v1.17.x (#1723)
* Drop support for go v1.17.x Signed-off-by: sdghchj <sdghchj@qq.com>
1 parent 6cdaaf5 commit 744a58e

File tree

14 files changed

+15
-206
lines changed

14 files changed

+15
-206
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
test:
1111
strategy:
1212
matrix:
13-
go: [ '1.17.x', '1.18.x', '1.19.x', '1.20.x' ]
13+
go: [ '1.18.x', '1.19.x', '1.20.x', '1.21.x' ]
1414
platform: [ubuntu-latest, macos-latest]
1515
runs-on: ${{ matrix.platform }}
1616
steps:

Makefile

+2-7
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ GOBUILD:=$(GOCMD) build
66
GOINSTALL:=$(GOCMD) install
77
GOCLEAN:=$(GOCMD) clean
88
GOTEST:=$(GOCMD) test
9+
GOMODTIDY:=$(GOCMD) mod tidy
910
GOGET:=$(GOCMD) get
1011
GOLIST:=$(GOCMD) list
1112
GOVET:=$(GOCMD) vet
@@ -54,13 +55,7 @@ clean:
5455

5556
.PHONY: deps
5657
deps:
57-
$(GOGET) github.com/swaggo/cli
58-
$(GOGET) sigs.k8s.io/yaml
59-
$(GOGET) github.com/KyleBanks/depth
60-
$(GOGET) github.com/go-openapi/jsonreference
61-
$(GOGET) github.com/go-openapi/spec
62-
$(GOGET) github.com/stretchr/testify/assert
63-
$(GOGET) golang.org/x/tools/go/loader
58+
$(GOMODTIDY)
6459

6560
.PHONY: devel-deps
6661
devel-deps:

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Swag converts Go annotations to Swagger Documentation 2.0. We've created a varie
5555
```sh
5656
go install github.com/swaggo/swag/cmd/swag@latest
5757
```
58-
To build from source you need [Go](https://golang.org/dl/) (1.17 or newer).
58+
To build from source you need [Go](https://golang.org/dl/) (1.18 or newer).
5959

6060
Alternatively you can run the docker image:
6161
```sh

README_pt.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Swag converte anotações Go para Documentação Swagger 2.0. Criámos uma varie
5454
```sh
5555
go install github.com/swaggo/swag/cmd/swag@latest
5656
```
57-
Para construir a partir da fonte é necessário [Go](https://golang.org/dl/) (1.17 ou mais recente).
57+
Para construir a partir da fonte é necessário [Go](https://golang.org/dl/) (1.18 ou mais recente).
5858

5959
Ou descarregar um binário pré-compilado a partir da [página de lançamento](https://github.com/swaggo/swag/releases).
6060

README_zh-CN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Swag将Go的注释转换为Swagger2.0文档。我们为流行的 [Go Web Framewo
5050
go install github.com/swaggo/swag/cmd/swag@latest
5151
```
5252

53-
从源码开始构建的话,需要有Go环境(1.17及以上版本)。
53+
从源码开始构建的话,需要有Go环境(1.18及以上版本)。
5454

5555
或者从github的release页面下载预编译好的二进制文件。
5656

const.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"reflect"
77
"strconv"
88
"strings"
9+
"unicode/utf8"
910
)
1011

1112
// ConstVariable a model to record a const variable
@@ -60,7 +61,7 @@ func EvaluateEscapedString(text string) string {
6061
i++
6162
char, err := strconv.ParseInt(text[i:i+4], 16, 32)
6263
if err == nil {
63-
result = AppendUtf8Rune(result, rune(char))
64+
result = utf8.AppendRune(result, rune(char))
6465
}
6566
i += 3
6667
} else if c, ok := escapedChars[text[i]]; ok {
@@ -404,7 +405,7 @@ func EvaluateUnary(x interface{}, operator token.Token, xtype ast.Expr) (interfa
404405
func EvaluateBinary(x, y interface{}, operator token.Token, xtype, ytype ast.Expr) (interface{}, ast.Expr) {
405406
if operator == token.SHR || operator == token.SHL {
406407
var rightOperand uint64
407-
yValue := CanIntegerValue{reflect.ValueOf(y)}
408+
yValue := reflect.ValueOf(y)
408409
if yValue.CanUint() {
409410
rightOperand = yValue.Uint()
410411
} else if yValue.CanInt() {
@@ -467,8 +468,8 @@ func EvaluateBinary(x, y interface{}, operator token.Token, xtype, ytype ast.Exp
467468
evalType = ytype
468469
}
469470

470-
xValue := CanIntegerValue{reflect.ValueOf(x)}
471-
yValue := CanIntegerValue{reflect.ValueOf(y)}
471+
xValue := reflect.ValueOf(x)
472+
yValue := reflect.ValueOf(y)
472473
if xValue.Kind() == reflect.String && yValue.Kind() == reflect.String {
473474
return xValue.String() + yValue.String(), evalType
474475
}

example/celler/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/swaggo/swag/example/celler
22

3-
go 1.17
3+
go 1.18
44

55
require (
66
github.com/gin-gonic/gin v1.9.1

example/go-module-support/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/swaggo/swag/example/go-module-support
22

3-
go 1.17
3+
go 1.18
44

55
require (
66
github.com/gin-gonic/gin v1.9.1

example/markdown/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/swaggo/swag/example/markdown
22

3-
go 1.17
3+
go 1.18
44

55
require (
66
github.com/gorilla/mux v1.8.0

example/object-map-example/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/swaggo/swag/example/object-map-example
22

3-
go 1.17
3+
go 1.18
44

55
require (
66
github.com/gin-gonic/gin v1.9.1

generics_other.go

-42
This file was deleted.

generics_other_test.go

-67
This file was deleted.

utils_go18.go

-31
This file was deleted.

utils_other.go

-47
This file was deleted.

0 commit comments

Comments
 (0)