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

Drop support for go v1.17.x #1723

Merged
merged 2 commits into from
Dec 18, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
test:
strategy:
matrix:
go: [ '1.17.x', '1.18.x', '1.19.x', '1.20.x' ]
go: [ '1.18.x', '1.19.x', '1.20.x', '1.21.x' ]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ GOBUILD:=$(GOCMD) build
GOINSTALL:=$(GOCMD) install
GOCLEAN:=$(GOCMD) clean
GOTEST:=$(GOCMD) test
GOMODTIDY:=$(GOCMD) mod tidy
GOGET:=$(GOCMD) get
GOLIST:=$(GOCMD) list
GOVET:=$(GOCMD) vet
Expand Down Expand Up @@ -54,13 +55,7 @@ clean:

.PHONY: deps
deps:
$(GOGET) github.com/swaggo/cli
$(GOGET) sigs.k8s.io/yaml
$(GOGET) github.com/KyleBanks/depth
$(GOGET) github.com/go-openapi/jsonreference
$(GOGET) github.com/go-openapi/spec
$(GOGET) github.com/stretchr/testify/assert
$(GOGET) golang.org/x/tools/go/loader
$(GOMODTIDY)

.PHONY: devel-deps
devel-deps:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Swag converts Go annotations to Swagger Documentation 2.0. We've created a varie
```sh
go install github.com/swaggo/swag/cmd/swag@latest
```
To build from source you need [Go](https://golang.org/dl/) (1.17 or newer).
To build from source you need [Go](https://golang.org/dl/) (1.18 or newer).

Alternatively you can run the docker image:
```sh
Expand Down
2 changes: 1 addition & 1 deletion README_pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Swag converte anotações Go para Documentação Swagger 2.0. Criámos uma varie
```sh
go install github.com/swaggo/swag/cmd/swag@latest
```
Para construir a partir da fonte é necessário [Go](https://golang.org/dl/) (1.17 ou mais recente).
Para construir a partir da fonte é necessário [Go](https://golang.org/dl/) (1.18 ou mais recente).

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

Expand Down
2 changes: 1 addition & 1 deletion README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Swag将Go的注释转换为Swagger2.0文档。我们为流行的 [Go Web Framewo
go install github.com/swaggo/swag/cmd/swag@latest
```

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

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

Expand Down
9 changes: 5 additions & 4 deletions const.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"reflect"
"strconv"
"strings"
"unicode/utf8"
)

// ConstVariable a model to record a const variable
Expand Down Expand Up @@ -60,7 +61,7 @@ func EvaluateEscapedString(text string) string {
i++
char, err := strconv.ParseInt(text[i:i+4], 16, 32)
if err == nil {
result = AppendUtf8Rune(result, rune(char))
result = utf8.AppendRune(result, rune(char))
}
i += 3
} else if c, ok := escapedChars[text[i]]; ok {
Expand Down Expand Up @@ -404,7 +405,7 @@ func EvaluateUnary(x interface{}, operator token.Token, xtype ast.Expr) (interfa
func EvaluateBinary(x, y interface{}, operator token.Token, xtype, ytype ast.Expr) (interface{}, ast.Expr) {
if operator == token.SHR || operator == token.SHL {
var rightOperand uint64
yValue := CanIntegerValue{reflect.ValueOf(y)}
yValue := reflect.ValueOf(y)
if yValue.CanUint() {
rightOperand = yValue.Uint()
} else if yValue.CanInt() {
Expand Down Expand Up @@ -467,8 +468,8 @@ func EvaluateBinary(x, y interface{}, operator token.Token, xtype, ytype ast.Exp
evalType = ytype
}

xValue := CanIntegerValue{reflect.ValueOf(x)}
yValue := CanIntegerValue{reflect.ValueOf(y)}
xValue := reflect.ValueOf(x)
yValue := reflect.ValueOf(y)
if xValue.Kind() == reflect.String && yValue.Kind() == reflect.String {
return xValue.String() + yValue.String(), evalType
}
Expand Down
2 changes: 1 addition & 1 deletion example/celler/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/swaggo/swag/example/celler

go 1.17
go 1.18

require (
github.com/gin-gonic/gin v1.9.1
Expand Down
2 changes: 1 addition & 1 deletion example/go-module-support/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/swaggo/swag/example/go-module-support

go 1.17
go 1.18

require (
github.com/gin-gonic/gin v1.9.1
Expand Down
2 changes: 1 addition & 1 deletion example/markdown/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/swaggo/swag/example/markdown

go 1.17
go 1.18

require (
github.com/gorilla/mux v1.8.0
Expand Down
2 changes: 1 addition & 1 deletion example/object-map-example/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/swaggo/swag/example/object-map-example

go 1.17
go 1.18

require (
github.com/gin-gonic/gin v1.9.1
Expand Down
42 changes: 0 additions & 42 deletions generics_other.go

This file was deleted.

67 changes: 0 additions & 67 deletions generics_other_test.go

This file was deleted.

31 changes: 0 additions & 31 deletions utils_go18.go

This file was deleted.

47 changes: 0 additions & 47 deletions utils_other.go

This file was deleted.