From 9bf3195743d49358a572742a9b3707c0f7ba92eb Mon Sep 17 00:00:00 2001 From: Hector Date: Mon, 8 Feb 2021 18:49:48 +0000 Subject: [PATCH] chore: move all source files to new folder Update the project structure to move all golang files to a new `src/` folder. This keeps all the code located in the same place and easier to work with. Update the Makefile and goreleaser config to continue to work with the new folder structure. --- .goreleaser.yml | 9 ++++----- Makefile | 10 +++++----- {cfg => src/cfg}/cfg.go | 0 {db => src/db}/db.go | 0 exporter.go => src/exporter.go | 0 go.mod => src/go.mod | 0 go.sum => src/go.sum | 0 7 files changed, 9 insertions(+), 10 deletions(-) rename {cfg => src/cfg}/cfg.go (100%) rename {db => src/db}/db.go (100%) rename exporter.go => src/exporter.go (100%) rename go.mod => src/go.mod (100%) rename go.sum => src/go.sum (100%) diff --git a/.goreleaser.yml b/.goreleaser.yml index 2325553..c6c6f2e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -2,12 +2,11 @@ # Make sure to check the documentation at http://goreleaser.com before: hooks: - # You may remove this if you don't use go modules. - - go mod download - # you may remove this if you don't need go generate - - go generate ./... + - make install-deps builds: - - goos: + - + dir: src + goos: - linux - windows - darwin diff --git a/Makefile b/Makefile index 3dfe3af..3f57577 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,18 @@ install-deps: - go mod download + cd src/ && go mod download # Standard go test test: - go test ./... -v -race + cd src/ && go test ./... -v -race # Make sure no unnecessary dependencies are present go-mod-tidy: - go mod tidy -v + cd src/ && go mod tidy -v git diff-index --quiet HEAD format: - go fmt $(go list ./... | grep -v /vendor/) - go vet $(go list ./... | grep -v /vendor/) + cd src/ && go fmt $(go list ./... | grep -v /vendor/) + cd src/ && go vet $(go list ./... | grep -v /vendor/) generateChangelog: ./tools/git-chglog_linux_amd64 --config tools/chglog/config.yml 0.0.0.. > CHANGELOG.md diff --git a/cfg/cfg.go b/src/cfg/cfg.go similarity index 100% rename from cfg/cfg.go rename to src/cfg/cfg.go diff --git a/db/db.go b/src/db/db.go similarity index 100% rename from db/db.go rename to src/db/db.go diff --git a/exporter.go b/src/exporter.go similarity index 100% rename from exporter.go rename to src/exporter.go diff --git a/go.mod b/src/go.mod similarity index 100% rename from go.mod rename to src/go.mod diff --git a/go.sum b/src/go.sum similarity index 100% rename from go.sum rename to src/go.sum