From bf643e6cf620c250cdc9c945ccadec0f0a6a7afb Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Fri, 10 May 2024 00:12:14 +0400 Subject: [PATCH] Updated go.{mod,sum}, Makefile and .gitignore. --- .gitignore | 5 ++--- Makefile | 17 +++++++++-------- go.mod | 8 +++++++- go.sum | 6 ++++++ 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 99c8b97..67e1097 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ bin/* !bin/.keep .vscode -*.pug.go *.log -jade.go -mls-test +*_templ.go +*.db3* \ No newline at end of file diff --git a/Makefile b/Makefile index 2c39d27..ef2285e 100755 --- a/Makefile +++ b/Makefile @@ -13,19 +13,20 @@ LDFLAGS:= -ldflags "-s -w -X main.version=${VERSION}" -tags osusergo,netgo .PHONY: run install uninstall clean -${TARGET}: web/*.pug.go +${TARGET}: web/*_templ.go go build -o bin/$@ ${LDFLAGS} ${FLAGS} cmd/$@/main.go -web/*.pug.go: web/templates/*.pug -ifeq (,$(wildcard $(shell go env GOPATH)/bin/jade)) - go install github.com/Joker/jade/cmd/jade@latest +web/*_templ.go: web/*.templ +ifeq (,$(wildcard $(shell go env GOPATH)/bin/templ)) + go install github.com/a-h/templ/cmd/templ@latest endif - go generate web/web.go + $(shell go env GOPATH)/bin/templ generate run: - bin/dwelling-radio -listen 127.0.0.1:18322 -mls-file ./mls-test \ - -playlist /mnt/data/appdata/radio/playlists/all-rand - -fallback-song /mnt/data/appdata/radio/fallback.ogg + bin/dwelling-radio -listen 127.0.0.1:18322 \ + -playlist /mnt/data/appdata/radio/playlists/all-rand \ + -fallback-song /mnt/data/appdata/radio/fallback.ogg \ + -db test.db3 install: install -Dm 0755 bin/${TARGET} ${DESTDIR}${PREFIX}/bin/${TARGET} diff --git a/go.mod b/go.mod index 2c3dff1..2652e41 100644 --- a/go.mod +++ b/go.mod @@ -1,7 +1,13 @@ module dwelling-radio -go 1.17 +go 1.21 + +toolchain go1.22.3 require github.com/pkg/errors v0.9.1 require git.arav.su/Arav/httpr v0.3.2 + +require github.com/a-h/templ v0.2.680 + +require github.com/mattn/go-sqlite3 v1.14.22 diff --git a/go.sum b/go.sum index 9c3f8ae..38d9d9f 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,10 @@ git.arav.su/Arav/httpr v0.3.2 h1:a+ifu+9+FnQe6p/Kd4kgTDKAFN6zBOJjBTMjbAuHxVk= git.arav.su/Arav/httpr v0.3.2/go.mod h1:z0SVYwe5dBReeVuFU9QH2PmBxICJwchxqY5OfZbeVzU= +github.com/a-h/templ v0.2.680 h1:TflYFucxp5rmOxAXB9Xy3+QHTk8s8xG9+nCT/cLzjeE= +github.com/a-h/templ v0.2.680/go.mod h1:NQGQOycaPKBxRB14DmAaeIpcGC1AOBPJEMO4ozS7m90= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= +github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=