Skip to content

Commit

Permalink
🧹 chore: add go 1.20 to ci and readmes (#2322)
Browse files Browse the repository at this point in the history
* ✅ chore: add go 1.20 to ci and readmes

* 🧹 chore: add go 1.20 to ci and readmes

* update linter

* fix linter

* fix benchmarks

* fix benchmarks

* fix benchmarks
  • Loading branch information
efectn committed Feb 2, 2023
1 parent ac4ce21 commit 2820aef
Show file tree
Hide file tree
Showing 29 changed files with 35 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Fiber is **inspired** by Express, the most popular web framework on the Internet
We **listen** to our users in [issues](https://github.com/gofiber/fiber/issues), Discord [channel](https://gofiber.io/discord) _and all over the Internet_ to create a **fast**, **flexible** and **friendly** Go web framework for **any** task, **deadline** and developer **skill**! Just like Express does in the JavaScript world.

## ⚠️ Limitations
* Due to Fiber's usage of unsafe, the library may not always be compatible with the latest Go version. Fiber 2.40.0 has been tested with Go versions 1.16 to 1.19.
* Due to Fiber's usage of unsafe, the library may not always be compatible with the latest Go version. Fiber 2.40.0 has been tested with Go versions 1.16 to 1.20.
* Fiber is not compatible with net/http interfaces. This means you will not be able to use projects like gqlgen, go-swagger, or any others which are part of the net/http ecosystem.

## 👀 Examples
Expand Down
2 changes: 1 addition & 1 deletion .github/README_de.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Neue Gopher, welche von [Node.js](https://nodejs.org/en/about/) zu [Go](https://
Fiber ist **inspiriert** von Express.js, dem beliebtesten Web-Framework im Internet. Wir haben die **Leichtigkeit** von Express und die **Rohleistung** von Go kombiniert. Wenn du jemals eine Webanwendung mit Node.js implementiert hast (_mit Express.js oder ähnlichem_), werden dir viele Methoden und Prinzipien **sehr vertraut** vorkommen.

## ⚠️ Limitations
* Due to Fiber's usage of unsafe, the library may not always be compatible with the latest Go version. Fiber 2.40.0 has been tested with Go versions 1.16 to 1.19.
* Due to Fiber's usage of unsafe, the library may not always be compatible with the latest Go version. Fiber 2.40.0 has been tested with Go versions 1.16 to 1.20.
* Fiber is not compatible with net/http interfaces. This means you will not be able to use projects like gqlgen, go-swagger, or any others which are part of the net/http ecosystem.

## 👀 Beispiele
Expand Down
2 changes: 1 addition & 1 deletion .github/README_es.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Los nuevos gophers que hacen el cambio de [Node.js](https://nodejs.org/en/about/
Fiber está **inspirado** en Expressjs, el framework web más popular en Internet. Combinamos la **facilidad** de Express y **el rendimiento bruto** de Go. Si alguna vez ha implementado una aplicación web en Node.js ( _utilizando Express.js o similar_ ), muchos métodos y principios le parecerán **muy comunes** .

## ⚠️ Limitantes
* Debido a que Fiber utiliza unsafe, la biblioteca no siempre será compatible con la última versión de Go. Fiber 2.40.0 ha sido probado con las versiones de Go 1.16 a 1.19.
* Debido a que Fiber utiliza unsafe, la biblioteca no siempre será compatible con la última versión de Go. Fiber 2.40.0 ha sido probado con las versiones de Go 1.16 a 1.20.
* Fiber no es compatible con interfaces net/http. Esto significa que no lo podrá usar en proyectos como qglgen, go-swagger, u otros que son parte del ecosistema net/http.

## 👀 Ejemplos
Expand Down
2 changes: 1 addition & 1 deletion .github/README_fa.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Fiber از Express <b>الهام گرفته</b>, که محبوب ترین فری
</p>

## ⚠️ محدودیت ها
* به دلیل استفاده ناامن از Fiber, ممکن است کتابخانه همیشه با آخرین نسخه Go سازگار نباشد. Fiber 2.40.0 با زبان گو نسخه 1.16 تا 1.19 تست شده است.
* به دلیل استفاده ناامن از Fiber, ممکن است کتابخانه همیشه با آخرین نسخه Go سازگار نباشد. Fiber 2.40.0 با زبان گو نسخه 1.16 تا 1.20 تست شده است.
* فریمورک Fiber با پکیج net/http سازگار نیست. این بدان معناست شما نمی توانید از پکیج های مانند go-swagger, gqlgen یا سایر پروژه هایی که بخشی از اکوسیستم net/http هستند استفاده کنید.

<br>
Expand Down
2 changes: 1 addition & 1 deletion .github/README_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Les nouveaux gophers qui passent de [Node.js](https://nodejs.org/en/about/) à [
Fiber est **inspiré** par Express, le framework web le plus populaire d'Internet. Nous avons combiné la **facilité** d'Express, et la **performance brute** de Go. Si vous avez déja développé une application web en Node.js (_en utilisant Express ou équivalent_), alors de nombreuses méthodes et principes vous sembleront **familiers**.

## ⚠️ Limitations
* Due to Fiber's usage of unsafe, the library may not always be compatible with the latest Go version. Fiber 2.40.0 has been tested with Go versions 1.16 to 1.19.
* Due to Fiber's usage of unsafe, the library may not always be compatible with the latest Go version. Fiber 2.40.0 has been tested with Go versions 1.16 to 1.20.
* Fiber is not compatible with net/http interfaces. This means you will not be able to use projects like gqlgen, go-swagger, or any others which are part of the net/http ecosystem.

## 👀 Exemples
Expand Down
2 changes: 1 addition & 1 deletion .github/README_he.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ Fiber נוצרה **בהשראת** Express, ה-web framework הפופולרית
<div dir="rtl">

## ⚠️ Limitations
* Due to Fiber's usage of unsafe, the library may not always be compatible with the latest Go version. Fiber 2.40.0 has been tested with Go versions 1.16 to 1.19.
* Due to Fiber's usage of unsafe, the library may not always be compatible with the latest Go version. Fiber 2.40.0 has been tested with Go versions 1.16 to 1.20.
* Fiber is not compatible with net/http interfaces. This means you will not be able to use projects like gqlgen, go-swagger, or any others which are part of the net/http ecosystem.

## 👀 דוגמאות
Expand Down
2 changes: 1 addition & 1 deletion .github/README_id.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Kami **mendengarkan** para pengguna di [GitHub Issues](https://github.com/gofibe

## ⚠️ Limitasi

* Karena penggunaan Fiber yang tidak aman, perpustakaan mungkin tidak selalu kompatibel dengan versi Go terbaru. Fiber 2.40.0 telah diuji dengan Go versi 1.16 hingga 1.19.
* Karena penggunaan Fiber yang tidak aman, perpustakaan mungkin tidak selalu kompatibel dengan versi Go terbaru. Fiber 2.40.0 telah diuji dengan Go versi 1.16 hingga 1.20.
* Fiber tidak kompatibel dengan antarmuka net/http. Ini berarti kamu tidak akan dapat menggunakan proyek seperti gqlgen, go-swagger, atau lainnya yang merupakan bagian dari ekosistem net/http.

## 👀 Contoh
Expand Down
2 changes: 1 addition & 1 deletion .github/README_it.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Fiber è **ispirato** da Express, il web framework più popolare su internet. Ab

## ⚠️ Limitazioni

* Dato che Fiber utilizza unsafe, la libreria non sempre potrebbe essere compatibile con l'ultima versione di Go. Fiber 2.40.0 è stato testato con la versioni 1.16 alla 1.19 di Go.
* Dato che Fiber utilizza unsafe, la libreria non sempre potrebbe essere compatibile con l'ultima versione di Go. Fiber 2.40.0 è stato testato con la versioni 1.16 alla 1.20 di Go.
* Fiber non è compatibile con le interfacce net/http. Questo significa che non è possibile utilizzare progetti come qglgen, go-swagger, o altri che fanno parte dell'ecosistema net/http.

## 👀 Esempi
Expand Down
2 changes: 1 addition & 1 deletion .github/README_ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Fiber は人気の高い Web フレームワークである Expressjs に**イ

## ⚠️ 制限事項

- Fiber は unsafe パッケージを使用しているため、最新の Go バージョンと互換性がない場合があります。Fiber 2.40.0 は、Go のバージョン 1.16 から 1.19 でテストされています。
- Fiber は unsafe パッケージを使用しているため、最新の Go バージョンと互換性がない場合があります。Fiber 2.40.0 は、Go のバージョン 1.16 から 1.20 でテストされています。
- Fiber は net/http インターフェースと互換性がありません。つまり、gqlgen や go-swagger など、net/http のエコシステムの一部であるプロジェクトを使用することができません。

## 👀 例
Expand Down
2 changes: 1 addition & 1 deletion .github/README_ko.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Fiber는 인터넷에서 가장 인기있는 웹 프레임워크인 Express에
우리는 **어떤한** 작업, **마감일정**, 개발자의 **기술**이던간에 **빠르고**, **유연하고**, **익숙한** Go 웹 프레임워크를 만들기 위해 사용자들의 [이슈들](https://github.com/gofiber/fiber/issues)을(그리고 모든 인터넷을 통해) **듣고 있습니다**! Express가 자바스크립트 세계에서 하는 것 처럼요.

## ⚠️ 한계점
* Fiber는 unsafe 패키지를 사용하기 때문에 최신 Go버전과 호환되지 않을 수 있습니다.Fiber 2.40.0은 Go 버전 1.16에서 1.19로 테스트되고 있습니다.
* Fiber는 unsafe 패키지를 사용하기 때문에 최신 Go버전과 호환되지 않을 수 있습니다.Fiber 2.40.0은 Go 버전 1.16에서 1.20로 테스트되고 있습니다.
* Fiber는 net/http 인터페이스와 호환되지 않습니다.즉, gqlgen이나 go-swagger 등 net/http 생태계의 일부인 프로젝트를 사용할 수 없습니다.

## 👀 예제
Expand Down
2 changes: 1 addition & 1 deletion .github/README_nl.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Fiber is **geïnspireerd** door Express, het populairste webframework op interne
We **luisteren** naar onze gebruikers in [issues](https://github.com/gofiber/fiber/issues) (_en overal op het internet_) om een **snelle**, **flexibele** en **vriendelijk** Go web framework te maken voor **elke** taak, **deadline** en ontwikkelaar **vaardigheid**! Net zoals Express dat doet in de JavaScript-wereld.

## ⚠️ Limitations
* Due to Fiber's usage of unsafe, the library may not always be compatible with the latest Go version. Fiber 2.40.0 has been tested with Go versions 1.16 to 1.19.
* Due to Fiber's usage of unsafe, the library may not always be compatible with the latest Go version. Fiber 2.40.0 has been tested with Go versions 1.16 to 1.20.
* Fiber is not compatible with net/http interfaces. This means you will not be able to use projects like gqlgen, go-swagger, or any others which are part of the net/http ecosystem.

## 👀 Voorbeelden
Expand Down
2 changes: 1 addition & 1 deletion .github/README_pt.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Os novos gophers que mudaram do [Node.js](https://nodejs.org/en/about/) para o [
O Fiber é **inspirado** no Express, o framework web mais popular da Internet. Combinamos a **facilidade** do Express e com o **desempenho bruto** do Go. Se você já implementou um aplicativo web com Node.js ( _usando Express.js ou similar_ ), então muitos métodos e princípios parecerão **muito familiares** para você.

## ⚠️ Limitations
* Due to Fiber's usage of unsafe, the library may not always be compatible with the latest Go version. Fiber 2.40.0 has been tested with Go versions 1.16 to 1.19.
* Due to Fiber's usage of unsafe, the library may not always be compatible with the latest Go version. Fiber 2.40.0 has been tested with Go versions 1.16 to 1.20.
* Fiber is not compatible with net/http interfaces. This means you will not be able to use projects like gqlgen, go-swagger, or any others which are part of the net/http ecosystem.

## 👀 Exemplos
Expand Down
2 changes: 1 addition & 1 deletion .github/README_ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Fiber **вдохновлен** Express, самым популярным веб
Мы **прислушиваемся** к нашим пользователям в [issues](https://github.com/gofiber/fiber/issues), Discord [канале](https://gofiber.io/discord) _и в остальном Интернете_, чтобы создать **быстрый**, **гибкий** и **дружелюбный** веб фреймворк на Go для **любых** задач, **дедлайнов** и **уровней** разработчиков! Как это делает Express в мире JavaScript.

## ⚠️ Limitations
* Due to Fiber's usage of unsafe, the library may not always be compatible with the latest Go version. Fiber 2.40.0 has been tested with Go versions 1.16 to 1.19.
* Due to Fiber's usage of unsafe, the library may not always be compatible with the latest Go version. Fiber 2.40.0 has been tested with Go versions 1.16 to 1.20.
* Fiber is not compatible with net/http interfaces. This means you will not be able to use projects like gqlgen, go-swagger, or any others which are part of the net/http ecosystem.

## 👀 Примеры
Expand Down
2 changes: 1 addition & 1 deletion .github/README_sa.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Fiber هو **مستوحى** من Express, إطار الويب الأكثر شع
** و تطوير **مهارات**! فقط مثل Express تفعل لـ JavaScript عالم.

## ⚠️ Limitations
* Due to Fiber's usage of unsafe, the library may not always be compatible with the latest Go version. Fiber 2.40.0 has been tested with Go versions 1.16 to 1.19.
* Due to Fiber's usage of unsafe, the library may not always be compatible with the latest Go version. Fiber 2.40.0 has been tested with Go versions 1.16 to 1.20.
* Fiber is not compatible with net/http interfaces. This means you will not be able to use projects like gqlgen, go-swagger, or any others which are part of the net/http ecosystem.

## 👀 أمثلة
Expand Down
2 changes: 1 addition & 1 deletion .github/README_tr.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Fiber, internet üzerinde en popüler web framework'ü olan Express'ten **esinle

## ⚠️ Sınırlamalar

- Fiber unsafe kullanımı sebebiyle Go'nun son sürümüyle her zaman uyumlu olmayabilir. Fiber 2.40.0, Go 1.16 ile 1.19 sürümleriyle test edildi.
- Fiber unsafe kullanımı sebebiyle Go'nun son sürümüyle her zaman uyumlu olmayabilir. Fiber 2.40.0, Go 1.16 ile 1.20 sürümleriyle test edildi.
- Fiber net/http arabirimiyle uyumlu değildir. Yani gqlgen veya go-swagger gibi net/http ekosisteminin parçası olan projeleri kullanamazsınız.

## 👀 Örnekler
Expand Down
2 changes: 1 addition & 1 deletion .github/README_uk.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Fiber **натхненний** Express, найпопулярнішим веб-ф

## ⚠️ Обмеження

- Через те, що Fiber використовує unsafe, бібліотека не завжди може бути сумісною з останньою версією Go. Fiber 2.40.0 було протестовано з Go версій 1.16 до 1.19.
- Через те, що Fiber використовує unsafe, бібліотека не завжди може бути сумісною з останньою версією Go. Fiber 2.40.0 було протестовано з Go версій 1.16 до 1.20.
- Fiber не сумісний з інтерфейсами net/http. Це означає, що ви не зможете використовувати такі проекти, як gqlgen, go-swagger або будь-які інші, які є частиною екосистеми net/http.

## 👀 Приклади
Expand Down
2 changes: 1 addition & 1 deletion .github/README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ go get -u github.com/gofiber/fiber/v2
以及在互联网上的所有诉求,为了创建一个能让有着任何技术栈的开发者都能在 deadline 前完成任务的**迅速****灵活**以及**友好**`Go web` 框架,就像 `Express``JavaScript` 世界中一样。

## ⚠️ 限制
* 由于 Fiber 使用了 unsafe 特性,导致其可能与最新的 Go 版本不兼容。Fiber 2.40.0 已经在 Go 1.16 到 1.19 上测试过。
* 由于 Fiber 使用了 unsafe 特性,导致其可能与最新的 Go 版本不兼容。Fiber 2.40.0 已经在 Go 1.16 到 1.20 上测试过。
* Fiber 与 net/http 接口不兼容。也就是说你无法直接使用例如 gqlen,go-swagger 或者任何其他属于 net/http 生态的项目。

## 👀 示例
Expand Down
2 changes: 1 addition & 1 deletion .github/README_zh-TW.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Fiber **啟發自** Express——網際網路上最知名的 Web 框架,我們

## ⚠️ 限制

- 由於 Fiber 有用到 Unsafe,本函式庫有時可能無法相容最新版的 Go 語言。Fiber 2.40.0 已在 Go 1.16 至 1.19 的版本測試過。
- 由於 Fiber 有用到 Unsafe,本函式庫有時可能無法相容最新版的 Go 語言。Fiber 2.40.0 已在 Go 1.16 至 1.20 的版本測試過。
- Fiber 不相容 net/http 的介面,意味著您無法使用像是 gqlgen、go-swagger 或其他任何屬於 net/http 生態系統的專案。

## 👀 範例
Expand Down
8 changes: 3 additions & 5 deletions .github/testdata/testRoutes.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"testRoutes": [
{
"test_routes": [{
"method": "GET",
"path": "/authorizations"
},
Expand Down Expand Up @@ -957,8 +956,7 @@
"path": "/user/keys/1337"
}
],
"githubAPI": [
{
"github_api": [{
"method": "GET",
"path": "/authorizations"
},
Expand Down Expand Up @@ -1915,4 +1913,4 @@
"path": "/user/keys/:id"
}
]
}
}
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.18.x
go-version: 1.20.x
- name: Fetch Repository
uses: actions/checkout@v3
- name: Run Benchmark
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
- uses: actions/setup-go@v3
with:
# NOTE: Keep this in sync with the version from go.mod
go-version: 1.19
go-version: 1.20.x
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# NOTE: Keep this in sync with the version from .golangci.yml
version: v1.50.1
version: v1.51.0
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
Build:
strategy:
matrix:
go-version: [1.16.x, 1.17.x, 1.19.x]
go-version: [1.16.x, 1.18.x, 1.20.x]
platform: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/vulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.20.x
check-latest: true
- name: Fetch Repository
uses: actions/checkout@v3
Expand Down
3 changes: 2 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Created based on v1.50.1
# Created based on v1.51.0
# NOTE: Keep this in sync with the version in .github/workflows/linter.yml

run:
Expand Down Expand Up @@ -49,6 +49,7 @@ linters-settings:
disable:
- shadow
- fieldalignment
- loopclosure

grouper:
import-require-single-import: true
Expand Down
2 changes: 1 addition & 1 deletion app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ func Test_App_Static_Direct(t *testing.T) {

body, err = io.ReadAll(resp.Body)
utils.AssertEqual(t, nil, err)
utils.AssertEqual(t, true, strings.Contains(string(body), "testRoutes"))
utils.AssertEqual(t, true, strings.Contains(string(body), "test_routes"))
}

// go test -run Test_App_Static_MaxAge
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gofiber/fiber/v2

go 1.19
go 1.20

require (
github.com/google/uuid v1.3.0
Expand Down
8 changes: 4 additions & 4 deletions middleware/encryptcookie/encryptcookie.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ func New(config ...Config) fiber.Handler {
cookieValue.SetKeyBytes(key)
if c.Response().Header.Cookie(&cookieValue) {
encryptedValue, err := cfg.Encryptor(string(cookieValue.Value()), cfg.Key)
if err == nil {
cookieValue.SetValue(encryptedValue)
c.Response().Header.SetCookie(&cookieValue)
} else {
if err != nil {
panic(err)
}

cookieValue.SetValue(encryptedValue)
c.Response().Header.SetCookie(&cookieValue)
}
}
})
Expand Down
2 changes: 1 addition & 1 deletion path.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ func findGreedyParamLen(s string, searchCount int, segment *routeSegment) int {
// check all from right to left segments
for i := segment.PartCount; i > 0 && searchCount > 0; i-- {
searchCount--
if constPosition := strings.LastIndex(s, segment.ComparePart); constPosition != -1 {
if constPosition := strings.LastIndex(s, segment.ComparePart); constPosition != -1 { //nolint:revive // Actually not simpler
s = s[:constPosition]
} else {
break
Expand Down
1 change: 0 additions & 1 deletion utils/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ func ParseVendorSpecificContentType(cType string) string {
}

var parsableType string
//nolint:revive // Actually not simpler
if semiColonIndex := strings.Index(cType, ";"); semiColonIndex == -1 {
parsableType = cType[plusIndex+1:]
} else if plusIndex < semiColonIndex {
Expand Down

0 comments on commit 2820aef

Please sign in to comment.