mirror of https://github.com/hashicorp/consul
Fix bad int -> string conversions caught by go vet changes in 1.15 (#8739)
parent
5bfd69fe55
commit
7d58901ae8
|
@ -543,7 +543,7 @@ func deprecatedEnsureNodeWithoutIDCanRegister(t *testing.T, s *Store, nodeName s
|
|||
Node: nodeName,
|
||||
Address: "1.1.1.9",
|
||||
Meta: map[string]string{
|
||||
"version": string(txIdx),
|
||||
"version": fmt.Sprint(txIdx),
|
||||
},
|
||||
}
|
||||
if err := s.EnsureNode(txIdx, in); err != nil {
|
||||
|
|
|
@ -65,7 +65,7 @@ func testRegisterNode(t *testing.T, s *Store, idx uint64, nodeID string) {
|
|||
// testRegisterNodeWithChange registers a node and ensures it gets different from previous registration
|
||||
func testRegisterNodeWithChange(t *testing.T, s *Store, idx uint64, nodeID string) {
|
||||
testRegisterNodeWithMeta(t, s, idx, nodeID, map[string]string{
|
||||
"version": string(idx),
|
||||
"version": fmt.Sprint(idx),
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ func testRegisterNodeWithMeta(t *testing.T, s *Store, idx uint64, nodeID string,
|
|||
func testRegisterServiceWithChange(t *testing.T, s *Store, idx uint64, nodeID, serviceID string, modifyAccordingIndex bool) {
|
||||
meta := make(map[string]string)
|
||||
if modifyAccordingIndex {
|
||||
meta["version"] = string(idx)
|
||||
meta["version"] = fmt.Sprint(idx)
|
||||
}
|
||||
svc := &structs.NodeService{
|
||||
ID: serviceID,
|
||||
|
|
|
@ -1315,7 +1315,7 @@ func TestStructs_DirEntry_Clone(t *testing.T) {
|
|||
func TestStructs_ValidateServiceAndNodeMetadata(t *testing.T) {
|
||||
tooMuchMeta := make(map[string]string)
|
||||
for i := 0; i < metaMaxKeyPairs+1; i++ {
|
||||
tooMuchMeta[string(i)] = "value"
|
||||
tooMuchMeta[fmt.Sprint(i)] = "value"
|
||||
}
|
||||
type testcase struct {
|
||||
Meta map[string]string
|
||||
|
|
Loading…
Reference in New Issue