From 45763de9e6816b83ce3e4e06212fd95a1bec8fec Mon Sep 17 00:00:00 2001 From: Ben Visness Date: Wed, 10 Mar 2021 21:39:24 -0600 Subject: [PATCH] Put Go stuff in the /src folder --- .gitignore | 2 +- main.go | 10 ---------- {color => src/color}/color.go | 0 {config => src/config}/config.go.example | 0 {config => src/config}/types.go | 0 {db => src/db}/db.go | 4 ++-- {logging => src/logging}/logging.go | 4 ++-- src/main.go | 10 ++++++++++ {migration => src/migration}/migration.go | 8 ++++---- {migration => src/migration}/migrationTemplate.txt | 2 +- .../migrations/2021-03-10T051621Z_Initial.go | 2 +- {migration => src/migration}/migrations/migrations.go | 2 +- {migration => src/migration}/types/types.go | 0 {oops => src/oops}/oops.go | 0 {oops => src/oops}/oops_test.go | 0 {website => src/website}/website.go | 6 +++--- 16 files changed, 25 insertions(+), 25 deletions(-) delete mode 100644 main.go rename {color => src/color}/color.go (100%) rename {config => src/config}/config.go.example (100%) rename {config => src/config}/types.go (100%) rename {db => src/db}/db.go (88%) rename {logging => src/logging}/logging.go (97%) create mode 100644 src/main.go rename {migration => src/migration}/migration.go (97%) rename {migration => src/migration}/migrationTemplate.txt (90%) rename {migration => src/migration}/migrations/2021-03-10T051621Z_Initial.go (99%) rename {migration => src/migration}/migrations/migrations.go (76%) rename {migration => src/migration}/types/types.go (100%) rename {oops => src/oops}/oops.go (100%) rename {oops => src/oops}/oops_test.go (100%) rename {website => src/website}/website.go (93%) diff --git a/.gitignore b/.gitignore index cdee5c0..8d5afc8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -config/config.go +src/config/config.go .vscode diff --git a/main.go b/main.go deleted file mode 100644 index 29dc0a9..0000000 --- a/main.go +++ /dev/null @@ -1,10 +0,0 @@ -package main - -import ( - _ "git.handmade.network/hmn/hmn/migration" - "git.handmade.network/hmn/hmn/website" -) - -func main() { - website.WebsiteCommand.Execute() -} diff --git a/color/color.go b/src/color/color.go similarity index 100% rename from color/color.go rename to src/color/color.go diff --git a/config/config.go.example b/src/config/config.go.example similarity index 100% rename from config/config.go.example rename to src/config/config.go.example diff --git a/config/types.go b/src/config/types.go similarity index 100% rename from config/types.go rename to src/config/types.go diff --git a/db/db.go b/src/db/db.go similarity index 88% rename from db/db.go rename to src/db/db.go index 56e1297..09d8756 100644 --- a/db/db.go +++ b/src/db/db.go @@ -3,8 +3,8 @@ package db import ( "context" - "git.handmade.network/hmn/hmn/config" - "git.handmade.network/hmn/hmn/oops" + "git.handmade.network/hmn/hmn/src/config" + "git.handmade.network/hmn/hmn/src/oops" "github.com/jackc/pgx/v4" "github.com/jackc/pgx/v4/pgxpool" ) diff --git a/logging/logging.go b/src/logging/logging.go similarity index 97% rename from logging/logging.go rename to src/logging/logging.go index 34045e5..2181ee2 100644 --- a/logging/logging.go +++ b/src/logging/logging.go @@ -7,8 +7,8 @@ import ( "strconv" "strings" - "git.handmade.network/hmn/hmn/color" - "git.handmade.network/hmn/hmn/oops" + "git.handmade.network/hmn/hmn/src/color" + "git.handmade.network/hmn/hmn/src/oops" "github.com/rs/zerolog" "github.com/rs/zerolog/log" ) diff --git a/src/main.go b/src/main.go new file mode 100644 index 0000000..22f756c --- /dev/null +++ b/src/main.go @@ -0,0 +1,10 @@ +package main + +import ( + _ "git.handmade.network/hmn/hmn/src/migration" + "git.handmade.network/hmn/hmn/src/website" +) + +func main() { + website.WebsiteCommand.Execute() +} diff --git a/migration/migration.go b/src/migration/migration.go similarity index 97% rename from migration/migration.go rename to src/migration/migration.go index d96bf10..509f30e 100644 --- a/migration/migration.go +++ b/src/migration/migration.go @@ -10,10 +10,10 @@ import ( "strings" "time" - "git.handmade.network/hmn/hmn/db" - "git.handmade.network/hmn/hmn/migration/migrations" - "git.handmade.network/hmn/hmn/migration/types" - "git.handmade.network/hmn/hmn/website" + "git.handmade.network/hmn/hmn/src/db" + "git.handmade.network/hmn/hmn/src/migration/migrations" + "git.handmade.network/hmn/hmn/src/migration/types" + "git.handmade.network/hmn/hmn/src/website" "github.com/jackc/pgx/v4" "github.com/spf13/cobra" ) diff --git a/migration/migrationTemplate.txt b/src/migration/migrationTemplate.txt similarity index 90% rename from migration/migrationTemplate.txt rename to src/migration/migrationTemplate.txt index f9a130b..302f35e 100644 --- a/migration/migrationTemplate.txt +++ b/src/migration/migrationTemplate.txt @@ -3,7 +3,7 @@ package migrations import ( "time" - "git.handmade.network/hmn/hmn/migration/types" + "git.handmade.network/hmn/hmn/src/migration/types" "github.com/jackc/pgx/v4" ) diff --git a/migration/migrations/2021-03-10T051621Z_Initial.go b/src/migration/migrations/2021-03-10T051621Z_Initial.go similarity index 99% rename from migration/migrations/2021-03-10T051621Z_Initial.go rename to src/migration/migrations/2021-03-10T051621Z_Initial.go index 09d55bc..203a95e 100644 --- a/migration/migrations/2021-03-10T051621Z_Initial.go +++ b/src/migration/migrations/2021-03-10T051621Z_Initial.go @@ -4,7 +4,7 @@ import ( "context" "time" - "git.handmade.network/hmn/hmn/migration/types" + "git.handmade.network/hmn/hmn/src/migration/types" "github.com/jackc/pgx/v4" ) diff --git a/migration/migrations/migrations.go b/src/migration/migrations/migrations.go similarity index 76% rename from migration/migrations/migrations.go rename to src/migration/migrations/migrations.go index bce2533..c11c9e7 100644 --- a/migration/migrations/migrations.go +++ b/src/migration/migrations/migrations.go @@ -1,6 +1,6 @@ package migrations -import "git.handmade.network/hmn/hmn/migration/types" +import "git.handmade.network/hmn/hmn/src/migration/types" var All map[types.MigrationVersion]types.Migration = make(map[types.MigrationVersion]types.Migration) diff --git a/migration/types/types.go b/src/migration/types/types.go similarity index 100% rename from migration/types/types.go rename to src/migration/types/types.go diff --git a/oops/oops.go b/src/oops/oops.go similarity index 100% rename from oops/oops.go rename to src/oops/oops.go diff --git a/oops/oops_test.go b/src/oops/oops_test.go similarity index 100% rename from oops/oops_test.go rename to src/oops/oops_test.go diff --git a/website/website.go b/src/website/website.go similarity index 93% rename from website/website.go rename to src/website/website.go index 1a21827..ee73a52 100644 --- a/website/website.go +++ b/src/website/website.go @@ -9,9 +9,9 @@ import ( "os/signal" "time" - "git.handmade.network/hmn/hmn/config" - "git.handmade.network/hmn/hmn/db" - "git.handmade.network/hmn/hmn/logging" + "git.handmade.network/hmn/hmn/src/config" + "git.handmade.network/hmn/hmn/src/db" + "git.handmade.network/hmn/hmn/src/logging" "github.com/julienschmidt/httprouter" "github.com/spf13/cobra" )