🩹 fix test

This commit is contained in:
Fenny
2020-11-27 15:13:23 +01:00
parent 9b7d6b130f
commit a956dc9144
3 changed files with 4 additions and 9 deletions

View File

@@ -33,6 +33,6 @@ jobs:
- name: Run Test
run: cd ./arangodb && go test ./... -v -race
env:
ARANGO_DATABASE: fiber
ARANGO_USERNAME: username
ARANGO_PASSWORD: password
ARANGO_DATABASE: fiber

View File

@@ -40,7 +40,7 @@ func New(config Config) *Storage {
// create connection object to arango
conn, err := http.NewConnection(http.ConnectionConfig{
Endpoints: []string{cfg.hostComposed()},
Endpoints: []string{fmt.Sprintf("%s:%d", cfg.Host, cfg.Port)},
})
if err != nil {
panic(err)

View File

@@ -1,7 +1,6 @@
package arangodb
import (
"fmt"
"strings"
"time"
)
@@ -20,12 +19,12 @@ type Config struct {
// Server username
//
// Mandatory
// Optional. Default is ""
Username string
// Server password
//
// Mandatory
// Optional. Default is ""
Password string
// Database name
@@ -58,10 +57,6 @@ var ConfigDefault = Config{
GCInterval: 10 * time.Second,
}
func (c Config) hostComposed() string {
return fmt.Sprintf("%s:%d", c.Host, c.Port)
}
// Helper function to set default values
func configDefault(cfg Config) Config {
// Set default values