From 50105f0559f514b308e6997163cb6da99ae6b9fe Mon Sep 17 00:00:00 2001 From: Dreamacro <8615343+Dreamacro@users.noreply.github.com> Date: Sun, 7 Aug 2022 21:45:50 +0800 Subject: [PATCH] Migration: go1.19 --- .github/workflows/linter.yml | 2 +- .github/workflows/release.yml | 2 +- .golangci.yaml | 2 +- constant/mime/mime.go | 16 ---------------- hub/route/server.go | 1 - test/.golangci.yaml | 2 +- 6 files changed, 4 insertions(+), 21 deletions(-) delete mode 100644 constant/mime/mime.go diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index ea07674a..f7763147 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -10,7 +10,7 @@ jobs: uses: actions/setup-go@v3 with: check-latest: true - go-version: '1.18' + go-version: '1.19' - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e1f5d68d..7d85cebf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,7 +8,7 @@ jobs: uses: actions/setup-go@v3 with: check-latest: true - go-version: '1.18' + go-version: '1.19' - name: Check out code into the Go module directory uses: actions/checkout@v3 diff --git a/.golangci.yaml b/.golangci.yaml index cfe4f07f..f5b67397 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -14,4 +14,4 @@ linters-settings: - prefix(github.com/Dreamacro/clash) - default staticcheck: - go: '1.18' + go: '1.19' diff --git a/constant/mime/mime.go b/constant/mime/mime.go deleted file mode 100644 index 431457be..00000000 --- a/constant/mime/mime.go +++ /dev/null @@ -1,16 +0,0 @@ -package mime - -import ( - "mime" -) - -var consensusMimes = map[string]string{ - // rfc4329: text/javascript is obsolete, so we need to overwrite mime's builtin - ".js": "application/javascript; charset=utf-8", -} - -func init() { - for ext, typ := range consensusMimes { - mime.AddExtensionType(ext, typ) - } -} diff --git a/hub/route/server.go b/hub/route/server.go index d5d8f726..d1f85e53 100644 --- a/hub/route/server.go +++ b/hub/route/server.go @@ -9,7 +9,6 @@ import ( "time" C "github.com/Dreamacro/clash/constant" - _ "github.com/Dreamacro/clash/constant/mime" "github.com/Dreamacro/clash/log" "github.com/Dreamacro/clash/tunnel/statistic" diff --git a/test/.golangci.yaml b/test/.golangci.yaml index cfaed770..b65afc5e 100644 --- a/test/.golangci.yaml +++ b/test/.golangci.yaml @@ -13,4 +13,4 @@ linters-settings: - prefix(github.com/Dreamacro/clash) - default staticcheck: - go: '1.18' + go: '1.19'