From 73b70a7eee026ce97c5646cea90343b441309fb3 Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Fri, 1 Dec 2023 17:48:56 +0100 Subject: [PATCH 1/2] chore: move main to the cmd --- Makefile | 2 +- cmd/{ => cmd}/cmd_utils.go | 0 cmd/{ => cmd}/root.go | 0 cmd/{ => cmd}/serve.go | 0 cmd/{ => cmd}/start.go | 0 main.go => cmd/main.go | 2 +- 6 files changed, 2 insertions(+), 2 deletions(-) rename cmd/{ => cmd}/cmd_utils.go (100%) rename cmd/{ => cmd}/root.go (100%) rename cmd/{ => cmd}/serve.go (100%) rename cmd/{ => cmd}/start.go (100%) rename main.go => cmd/main.go (55%) diff --git a/Makefile b/Makefile index 2831789..43348ff 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ generate: go generate ./... build: - go build -o bin/$(BINARY_NAME) -v . + go build -o bin/$(BINARY_NAME) -v ./cmd docker: docker build -t bittwister . diff --git a/cmd/cmd_utils.go b/cmd/cmd/cmd_utils.go similarity index 100% rename from cmd/cmd_utils.go rename to cmd/cmd/cmd_utils.go diff --git a/cmd/root.go b/cmd/cmd/root.go similarity index 100% rename from cmd/root.go rename to cmd/cmd/root.go diff --git a/cmd/serve.go b/cmd/cmd/serve.go similarity index 100% rename from cmd/serve.go rename to cmd/cmd/serve.go diff --git a/cmd/start.go b/cmd/cmd/start.go similarity index 100% rename from cmd/start.go rename to cmd/cmd/start.go diff --git a/main.go b/cmd/main.go similarity index 55% rename from main.go rename to cmd/main.go index e4e09a1..0f36e6b 100644 --- a/main.go +++ b/cmd/main.go @@ -1,7 +1,7 @@ package main import ( - "github.com/celestiaorg/bittwister/cmd" + "github.com/celestiaorg/bittwister/cmd/cmd" ) func main() { From c22f19f27f64fa898888263183e337e715fe694f Mon Sep 17 00:00:00 2001 From: Mojtaba Date: Mon, 4 Dec 2023 15:43:57 +0100 Subject: [PATCH 2/2] chore: rename cmd to the tool name --- cmd/{cmd => bittwister}/root.go | 2 +- cmd/{cmd => bittwister}/serve.go | 2 +- cmd/{cmd => bittwister}/start.go | 2 +- cmd/{cmd/cmd_utils.go => bittwister/utils.go} | 2 +- cmd/main.go | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) rename cmd/{cmd => bittwister}/root.go (94%) rename cmd/{cmd => bittwister}/serve.go (98%) rename cmd/{cmd => bittwister}/start.go (99%) rename cmd/{cmd/cmd_utils.go => bittwister/utils.go} (98%) diff --git a/cmd/cmd/root.go b/cmd/bittwister/root.go similarity index 94% rename from cmd/cmd/root.go rename to cmd/bittwister/root.go index cce7bcb..69a379d 100644 --- a/cmd/cmd/root.go +++ b/cmd/bittwister/root.go @@ -1,4 +1,4 @@ -package cmd +package bittwister import ( "context" diff --git a/cmd/cmd/serve.go b/cmd/bittwister/serve.go similarity index 98% rename from cmd/cmd/serve.go rename to cmd/bittwister/serve.go index 64d5018..fd25f1c 100644 --- a/cmd/cmd/serve.go +++ b/cmd/bittwister/serve.go @@ -1,4 +1,4 @@ -package cmd +package bittwister import ( "fmt" diff --git a/cmd/cmd/start.go b/cmd/bittwister/start.go similarity index 99% rename from cmd/cmd/start.go rename to cmd/bittwister/start.go index 7505f15..4bfbd2f 100644 --- a/cmd/cmd/start.go +++ b/cmd/bittwister/start.go @@ -1,4 +1,4 @@ -package cmd +package bittwister import ( "context" diff --git a/cmd/cmd/cmd_utils.go b/cmd/bittwister/utils.go similarity index 98% rename from cmd/cmd/cmd_utils.go rename to cmd/bittwister/utils.go index 5b2c536..07450f7 100644 --- a/cmd/cmd/cmd_utils.go +++ b/cmd/bittwister/utils.go @@ -1,4 +1,4 @@ -package cmd +package bittwister import ( "fmt" diff --git a/cmd/main.go b/cmd/main.go index 0f36e6b..66f24d4 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -1,9 +1,9 @@ package main import ( - "github.com/celestiaorg/bittwister/cmd/cmd" + "github.com/celestiaorg/bittwister/cmd/bittwister" ) func main() { - cmd.Execute() + bittwister.Execute() }