mirror of
https://github.com/eosswedenorg/antelope-api-healthcheck
synced 2026-08-31 21:38:12 +02:00
Fix code formatting
This commit is contained in:
parent
b0e5b455ca
commit
adb1ad3c6d
21 changed files with 884 additions and 950 deletions
|
|
@ -1,50 +1,47 @@
|
|||
|
||||
package api
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
|
||||
|
||||
func TestLogParams(t *testing.T) {
|
||||
type test_struct struct {
|
||||
First string
|
||||
Second int
|
||||
}
|
||||
|
||||
type test_struct struct {
|
||||
First string
|
||||
Second int
|
||||
}
|
||||
p := LogParams{}
|
||||
|
||||
p := LogParams{}
|
||||
p.Add("one", 1)
|
||||
p.Add("string", "str")
|
||||
p.Add("struct", test_struct{First: "first_string", Second: 1234})
|
||||
|
||||
p.Add("one", 1)
|
||||
p.Add("string", "str")
|
||||
p.Add("struct", test_struct{First:"first_string",Second:1234})
|
||||
expected := []interface{}([]interface{}{
|
||||
"one", 1,
|
||||
"string", "str",
|
||||
"struct",
|
||||
test_struct{
|
||||
First: "first_string",
|
||||
Second: 1234,
|
||||
},
|
||||
})
|
||||
|
||||
expected := []interface{}([]interface {}{
|
||||
"one",1,
|
||||
"string","str",
|
||||
"struct",test_struct{
|
||||
First:"first_string",
|
||||
Second:1234,
|
||||
},
|
||||
})
|
||||
|
||||
assert.ElementsMatch(t, expected, p)
|
||||
assert.ElementsMatch(t, expected, p)
|
||||
}
|
||||
|
||||
func TestLogParamsCombine(t *testing.T) {
|
||||
a := LogParams{"one", 1, "string1", "str1"}
|
||||
|
||||
a := LogParams{"one",1,"string1","str1"}
|
||||
b := LogParams{"two", 2, "string2", "str2"}
|
||||
|
||||
b := LogParams{"two",2,"string2","str2"}
|
||||
expected := LogParams{
|
||||
"one", 1,
|
||||
"string1", "str1",
|
||||
"two", 2,
|
||||
"string2", "str2",
|
||||
}
|
||||
|
||||
expected := LogParams{
|
||||
"one",1,
|
||||
"string1","str1",
|
||||
"two",2,
|
||||
"string2","str2",
|
||||
}
|
||||
|
||||
assert.Equal(t, expected, a.Combine(b))
|
||||
}
|
||||
assert.Equal(t, expected, a.Combine(b))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue