upgrade to go 1.16 and add a banner

This commit is contained in:
hdt3213
2021-05-02 15:42:29 +08:00
parent f29298cc68
commit 12b17750b2
5 changed files with 14 additions and 3 deletions

View File

@@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o target/godis-linux ./src/cmd CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o target/godis-linux ./cmd

View File

@@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
go build -i -o target/godis-darwin ./src/cmd go build -o target/godis-darwin ./cmd

6
cmd/banner.txt Normal file
View File

@@ -0,0 +1,6 @@
______ ___
/ ____/___ ____/ (_)____
/ / __/ __ \/ __ / / ___/
/ /_/ / /_/ / /_/ / (__ )
\____/\____/\__,_/_/____/

View File

@@ -1,6 +1,7 @@
package main package main
import ( import (
_ "embed"
"fmt" "fmt"
"github.com/hdt3213/godis/config" "github.com/hdt3213/godis/config"
"github.com/hdt3213/godis/lib/logger" "github.com/hdt3213/godis/lib/logger"
@@ -9,7 +10,11 @@ import (
"os" "os"
) )
//go:embed banner.txt
var banner string
func main() { func main() {
print(banner)
configFilename := os.Getenv("CONFIG") configFilename := os.Getenv("CONFIG")
if configFilename == "" { if configFilename == "" {
configFilename = "redis.conf" configFilename = "redis.conf"

2
go.mod
View File

@@ -1,6 +1,6 @@
module github.com/hdt3213/godis module github.com/hdt3213/godis
go 1.12 go 1.16
require ( require (
github.com/jolestar/go-commons-pool/v2 v2.1.1 github.com/jolestar/go-commons-pool/v2 v2.1.1