1
0
mirror of synced 2024-11-22 04:56:06 +03:00

update test matrix

This commit is contained in:
Pavel 2023-12-29 11:33:05 +03:00
parent a02b1fe885
commit 512aa5c6e8
2 changed files with 4 additions and 4 deletions

View File

@ -22,7 +22,7 @@ jobs:
- name: Set up latest Go 1.x version - name: Set up latest Go 1.x version
uses: actions/setup-go@v2 uses: actions/setup-go@v2
with: with:
go-version: '1.17' go-version: '1.21'
- name: Get dependencies - name: Get dependencies
run: | run: |
go mod tidy go mod tidy
@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
go-version: ['1.13', '1.14', '1.15', '1.16', '1.17'] go-version: ['1.13', '1.14', '1.15', '1.16', '1.17', '1.18', '1.19', '1.20', '1.21']
steps: steps:
- name: Set up Go ${{ matrix.go-version }} - name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2 uses: actions/setup-go@v2

View File

@ -85,12 +85,12 @@ func HandleTemplateDelete(rw http.ResponseWriter, tpl v1.TemplateDeleteWebhookDa
serveJSON(rw, http.StatusOK, H{}) serveJSON(rw, http.StatusOK, H{})
} }
func readJSON(req *http.Request, out any) error { func readJSON(req *http.Request, out interface{}) error {
defer func() { _ = req.Body.Close() }() defer func() { _ = req.Body.Close() }()
return json.NewDecoder(req.Body).Decode(out) return json.NewDecoder(req.Body).Decode(out)
} }
func serveJSON(rw http.ResponseWriter, st int, data any) { func serveJSON(rw http.ResponseWriter, st int, data interface{}) {
resp, _ := json.Marshal(data) resp, _ := json.Marshal(data)
rw.Header().Set("Content-Type", "application/json; charset=utf-8") rw.Header().Set("Content-Type", "application/json; charset=utf-8")
rw.WriteHeader(st) rw.WriteHeader(st)