1
0
mirror of synced 2024-11-21 20:46:05 +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
uses: actions/setup-go@v2
with:
go-version: '1.17'
go-version: '1.21'
- name: Get dependencies
run: |
go mod tidy
@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
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:
- name: Set up Go ${{ matrix.go-version }}
uses: actions/setup-go@v2

View File

@ -85,12 +85,12 @@ func HandleTemplateDelete(rw http.ResponseWriter, tpl v1.TemplateDeleteWebhookDa
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() }()
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)
rw.Header().Set("Content-Type", "application/json; charset=utf-8")
rw.WriteHeader(st)