Skip to content

Commit

Permalink
Fix bad int -> string conversions caught by go vet changes in 1.15 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
banks committed Sep 24, 2020
1 parent 5bfd69f commit 7d58901
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion agent/consul/state/catalog_test.go
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions agent/consul/state/state_store_test.go
Expand Up @@ -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),
})
}

Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion agent/structs/structs_test.go
Expand Up @@ -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
Expand Down

0 comments on commit 7d58901

Please sign in to comment.