drop sqlite
This commit is contained in:
@@ -2,11 +2,9 @@ package boxes
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/gommon/log"
|
||||
@@ -16,8 +14,6 @@ import (
|
||||
var (
|
||||
wsConnections = make(map[*websocket.Conn]bool)
|
||||
wsMutex sync.Mutex
|
||||
db = initDb()
|
||||
random = rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
)
|
||||
|
||||
type Box struct {
|
||||
@@ -69,10 +65,7 @@ func randomizeBoxes(count int) []Box {
|
||||
boxes := make([]Box, count)
|
||||
for i := 0; i < count; i++ {
|
||||
index := random.Int() % 1000
|
||||
box, err := getBox(index)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
box := getBox(index)
|
||||
box.Value = !box.Value
|
||||
box.persist()
|
||||
boxes[i] = box
|
||||
|
||||
Reference in New Issue
Block a user