updates project to go1.24.1 #2

Merged
Franz.Germann merged 6 commits from feature/update-project-to-go1.24.1 into development 2025-03-26 16:46:29 +00:00
5 changed files with 15 additions and 13 deletions

View file

@ -46,5 +46,5 @@ jobs:
push: true push: true
allow: network.host allow: network.host
network: host network: host
platforms: linux/amd64,linux/arm64 platforms: linux/amd64
tags: ${{ steps.docker.outputs.tags }} tags: ${{ steps.docker.outputs.tags }}

View file

@ -1,11 +1,11 @@
FROM golang:1.17-alpine AS build-env FROM golang:1.24.1-alpine AS build-env
ENV GO111MODULE=on ENV GO111MODULE=on
WORKDIR /go/src/github.com/hugomd/ascii-live/ WORKDIR /go/src/github.com/hugomd/ascii-live/
RUN apk add ca-certificates RUN apk add ca-certificates
COPY . /go/src/github.com/hugomd/ascii-live/ COPY . /go/src/github.com/hugomd/ascii-live/
RUN cd /go/src/github.com/hugomd/ascii-live && \ RUN cd /go/src/github.com/hugomd/ascii-live && \
go mod download && \ go mod download && \
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main . CGO_ENABLED=0 GOOS=linux go build -installsuffix cgo -o main .
FROM scratch FROM scratch
COPY --from=build-env /go/src/github.com/hugomd/ascii-live/main / COPY --from=build-env /go/src/github.com/hugomd/ascii-live/main /

6
go.mod
View file

@ -1,8 +1,8 @@
module github.com/hugomd/ascii-live module github.com/hugomd/ascii-live
go 1.17 go 1.24.1
require ( require (
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b github.com/golang/glog v1.2.4
github.com/gorilla/mux v1.7.3 github.com/gorilla/mux v1.8.1
) )

10
go.sum
View file

@ -1,4 +1,6 @@
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v1.2.4 h1:CNNw5U8lSiiBk7druxtSHHTsRWcxKoac6kZKm2peBBc=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/glog v1.2.4/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w=
github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=

View file

@ -15,7 +15,7 @@ import (
) )
var NotFoundMessage = map[string]string{ var NotFoundMessage = map[string]string{
"error": "Frames not found. Navigate to /list for list of frames. Navigate to https://github.com/hugomd/ascii-live to submit new frames.", "error": "Frames not found. Navigate to /ascii/list for list of frames. Navigate to https://github.com/hugomd/ascii-live to submit new frames.",
} }
var NotCurledMessage = map[string]string{ var NotCurledMessage = map[string]string{
@ -53,7 +53,7 @@ func notCurledHandler(w http.ResponseWriter, r *http.Request) {
} }
func handler(w http.ResponseWriter, r *http.Request) { func handler(w http.ResponseWriter, r *http.Request) {
cn := w.(http.CloseNotifier) ctx := r.Context()
flusher := w.(http.Flusher) flusher := w.(http.Flusher)
vars := mux.Vars(r) vars := mux.Vars(r)
@ -79,7 +79,7 @@ func handler(w http.ResponseWriter, r *http.Request) {
for { for {
select { select {
// Handle client disconnects // Handle client disconnects
case <-cn.CloseNotify(): case <-ctx.Done():
glog.Infof("Client stopped listening") glog.Infof("Client stopped listening")
return return
default: default: