diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a7e0aee --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +lash diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..687e7bb --- /dev/null +++ b/Makefile @@ -0,0 +1,12 @@ +GO?= go + +.PHONY: build lint + +all: build + +build: + $(GO) build -o lash ./cmd/lash/ + +lint: + $(GO) fmt ./... + $(GO) vet ./... diff --git a/internal/app/routes.go b/internal/app/routes.go index 0e3e5e3..07404c6 100644 --- a/internal/app/routes.go +++ b/internal/app/routes.go @@ -16,7 +16,7 @@ func New() http.Handler { } share := handlers.ShareData{ - Version: lash.Version, + Version: lash.Version, FileName: fp, } diff --git a/internal/errx/print.go b/internal/errx/print.go index 06a5d47..e7f8155 100644 --- a/internal/errx/print.go +++ b/internal/errx/print.go @@ -2,6 +2,6 @@ package errx import "fmt" -func Log(msg string, k... any) { - fmt.Printf("lash: " + msg + "\n", k...) +func Log(msg string, k ...any) { + fmt.Printf("lash: "+msg+"\n", k...) } diff --git a/lash.go b/lash.go index 56612b9..9d29168 100644 --- a/lash.go +++ b/lash.go @@ -1,6 +1,10 @@ package lash -import "embed" +import ( + "embed" + + "github.com/google/uuid" +) //go:embed templates/* var Templates embed.FS @@ -8,4 +12,4 @@ var Templates embed.FS //go:embed version var Version string -var Token string = "SICK-COOL-TOKEN" +var Token string = uuid.New().String()