Replace dep with go mod, migrate from travis to github-actions

This commit is contained in:
ErickSkrauch
2023-12-12 01:35:08 +01:00
parent 980c920ceb
commit 6accffed45
17 changed files with 273 additions and 501 deletions

View File

@@ -1,10 +1,13 @@
//go:build redis
// +build redis
package redis
import (
"fmt"
"os"
"reflect"
"strconv"
"testing"
"time"
@@ -15,7 +18,21 @@ import (
"github.com/elyby/chrly/model"
)
const redisAddr = "localhost:6379"
var redisAddr string
func init() {
host := "localhost"
port := 6379
if os.Getenv("STORAGE_REDIS_HOST") != "" {
host = os.Getenv("STORAGE_REDIS_HOST")
}
if os.Getenv("STORAGE_REDIS_PORT") != "" {
port, _ = strconv.Atoi(os.Getenv("STORAGE_REDIS_PORT"))
}
redisAddr = fmt.Sprintf("%s:%d", host, port)
}
func TestNew(t *testing.T) {
t.Run("should connect", func(t *testing.T) {