diff --git a/build-linux.sh b/build-linux.sh index ac55c5f6..2631615f 100755 --- a/build-linux.sh +++ b/build-linux.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o target/godis-linux ./src/cmd \ No newline at end of file +CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o target/godis-linux ./cmd \ No newline at end of file diff --git a/build.sh b/build.sh index 483b8186..4f4cbf00 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ #!/usr/bin/env bash -go build -i -o target/godis-darwin ./src/cmd +go build -o target/godis-darwin ./cmd diff --git a/cmd/banner.txt b/cmd/banner.txt new file mode 100644 index 00000000..70e838e8 --- /dev/null +++ b/cmd/banner.txt @@ -0,0 +1,6 @@ + ______ ___ + / ____/___ ____/ (_)____ + / / __/ __ \/ __ / / ___/ +/ /_/ / /_/ / /_/ / (__ ) +\____/\____/\__,_/_/____/ + diff --git a/cmd/main.go b/cmd/main.go index b34f4cc5..3e481b77 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -1,6 +1,7 @@ package main import ( + _ "embed" "fmt" "github.com/hdt3213/godis/config" "github.com/hdt3213/godis/lib/logger" @@ -9,7 +10,11 @@ import ( "os" ) +//go:embed banner.txt +var banner string + func main() { + print(banner) configFilename := os.Getenv("CONFIG") if configFilename == "" { configFilename = "redis.conf" diff --git a/go.mod b/go.mod index db7ef381..e397086b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/hdt3213/godis -go 1.12 +go 1.16 require ( github.com/jolestar/go-commons-pool/v2 v2.1.1