From 9d1b046d3076ce397796eef27fcfd47ebe05e8af Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Wed, 24 Dec 2025 22:18:09 -0500 Subject: [PATCH] Go module setup. --- .gitignore | 2 +- Makefile | 29 +++++++++++++++++++++++++++++ go.mod | 3 +++ main.go | 9 +++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 Makefile create mode 100644 go.mod create mode 100644 main.go diff --git a/.gitignore b/.gitignore index 7e480e2..789a9f9 100644 --- a/.gitignore +++ b/.gitignore @@ -31,4 +31,4 @@ config.toml public *.idx *.sqlite3 -webapp +ttarpit diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d946797 --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +build: + go build . + +compare: + ./ttarpit -input ./tests/images/bash_test.png -output none.png -pixel-width 4 -color-depth 16 -dither 0 + ./ttarpit -input ./tests/images/bash_test.png -output floyd.png -pixel-width 4 -color-depth 16 -dither 1 + ./ttarpit -input ./tests/images/bash_test.png -output atkinson.png -pixel-width 4 -color-depth 16 -dither 2 + +test: + go test MY/webapp/tests -c + ./tests.test + +test_only: + go test . -c -o + ./tests.test -test.run TestSomePage + +docs: + pkgsite --open + +coverage: + go build -cover -o webapp + mkdir -p .coverage + echo "GOCOVERDIR=.coverage ./webapp" + +cover_report: + go tool covdata textfmt -i=.coverage -o coverage.txt + go tool cover -func=coverage.txt + go tool cover -html=coverage.txt -o coverage.html + open coverage.html diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..0d7e0ba --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module lcthw.dev/go/ttarpit + +go 1.25.3 diff --git a/main.go b/main.go new file mode 100644 index 0000000..9da45fa --- /dev/null +++ b/main.go @@ -0,0 +1,9 @@ +package main + +import ( + "fmt" +) + +func main() { + fmt.Println("Hello!") +}