From 3e996996ea4ba8335a18343cc788c7585978a8fb Mon Sep 17 00:00:00 2001 From: Sam Hoffman Date: Fri, 30 Jan 2026 17:10:13 -0500 Subject: [PATCH] restructure and include Makefile --- .gitignore | 1 + Makefile | 11 +++++++++++ main.go => cmd/thanks/main.go | 0 internal/{cmd/cmd.go => runner/runner.go} | 0 internal/{cmd/cmd_test.go => runner/runner_test.go} | 0 internal/zfs/zfs_test.go | 2 +- 6 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 Makefile rename main.go => cmd/thanks/main.go (100%) rename internal/{cmd/cmd.go => runner/runner.go} (100%) rename internal/{cmd/cmd_test.go => runner/runner_test.go} (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e660fd9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +bin/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..291a29e --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +BINARY_NAME=thanks +VERSION=$(shell git describe --tags --always) +BUILD_TIME=$(shell date -u +%Y-%m-%dT%H:%M:%SZ) +LDFLAGS=-ldflags "-X main.Version=${VERSION} -X main.BuildTime=${BUILD_TIME}" + +.PHONY: all + +all: build-linux + +build-linux: + GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o bin/thanks ./cmd/thanks diff --git a/main.go b/cmd/thanks/main.go similarity index 100% rename from main.go rename to cmd/thanks/main.go diff --git a/internal/cmd/cmd.go b/internal/runner/runner.go similarity index 100% rename from internal/cmd/cmd.go rename to internal/runner/runner.go diff --git a/internal/cmd/cmd_test.go b/internal/runner/runner_test.go similarity index 100% rename from internal/cmd/cmd_test.go rename to internal/runner/runner_test.go diff --git a/internal/zfs/zfs_test.go b/internal/zfs/zfs_test.go index 7d646f9..ddaa201 100644 --- a/internal/zfs/zfs_test.go +++ b/internal/zfs/zfs_test.go @@ -1,4 +1,4 @@ -package main_test +package zfs_test import ( "fmt"