From 168fa0a194a9cdc15ba22cae154402bf8939168c Mon Sep 17 00:00:00 2001 From: Colin Arnott Date: Mon, 26 Dec 2022 01:58:32 +0000 Subject: [PATCH 1/2] add go module This is a minimum viable change to enable modern go toolchains to build github.com/andreaskoch/allmark/cli in go module mode. The module is not tidy, and we are relying on ./vendor, but it does build. --- go.mod | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 go.mod diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..75fbcfdc --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/andreaskoch/allmark + +go 1.19 From 72458375e2013a8904777dedfc3f345cc1a8db34 Mon Sep 17 00:00:00 2001 From: Colin Arnott Date: Mon, 26 Dec 2022 02:19:37 +0000 Subject: [PATCH 2/2] adjust file heirarchy to use cmd/allmark The use of the cli directory works, but makes go-get painful to use. This change adopts the standard cmd directory for main packages, and allows for go get github.com/andreaskoch/allmark/cmd/allmark. Note this is a breaking change, as go get github.com/andreaskoch/allmark/cli will not do what it did before. --- Makefile | 18 +++++++++--------- {cli => cmd/allmark}/allmark.go | 0 2 files changed, 9 insertions(+), 9 deletions(-) rename {cli => cmd/allmark}/allmark.go (100%) diff --git a/Makefile b/Makefile index ebdad632..973ed610 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,16 @@ build: - go build -o bin/files/allmark ./cli + go build -o bin/files/ ./cmd/... install: - go build -o bin/files/allmark ./cli + go build -o bin/files/ ./cmd/... test: - go test ./cli ./common/... ./dataaccess/... ./model/... ./services/... ./web/... + go test ./common/... ./cmd/... ./dataaccess/... ./model/... ./services/... ./web/... crosscompile: - GOOS=linux GOARCH=amd64 go build -o bin/files/allmark_linux_amd64 ./cli - GOOS=linux GOARCH=arm GOARM=5 go build -o bin/files/allmark_linux_arm_5 ./cli - GOOS=linux GOARCH=arm GOARM=6 go build -o bin/files/allmark_linux_arm_6 ./cli - GOOS=linux GOARCH=arm GOARM=7 go build -o bin/files/allmark_linux_arm_7 ./cli - GOOS=darwin GOARCH=amd64 go build -o bin/files/allmark_darwin_amd64 ./cli - GOOS=windows GOARCH=amd64 go build -o bin/files/allmark_windows_amd64 ./cli + GOOS=linux GOARCH=amd64 go build -o bin/files/allmark_linux_amd64 ./cmd/allmark + GOOS=linux GOARCH=arm GOARM=5 go build -o bin/files/allmark_linux_arm_5 ./cmd/allmark + GOOS=linux GOARCH=arm GOARM=6 go build -o bin/files/allmark_linux_arm_6 ./cmd/allmark + GOOS=linux GOARCH=arm GOARM=7 go build -o bin/files/allmark_linux_arm_7 ./cmd/allmark + GOOS=darwin GOARCH=amd64 go build -o bin/files/allmark_darwin_amd64 ./cmd/allmark + GOOS=windows GOARCH=amd64 go build -o bin/files/allmark_windows_amd64 ./cmd/allmark diff --git a/cli/allmark.go b/cmd/allmark/allmark.go similarity index 100% rename from cli/allmark.go rename to cmd/allmark/allmark.go