redhat-cop / global-load-balancer-operator

A global load balancer operator for OpenShift
Apache License 2.0
53 stars 16 forks source link

Vet fails on go 1.15 #15

Closed davidlanouette closed 4 years ago

davidlanouette commented 4 years ago

When running make, go vet fails:

pkg/controller/globalroutediscovery/globalroutediscovery_controller.go:296:93: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
pkg/controller/globalroutediscovery/globalroutediscovery_controller.go:301:113: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
pkg/controller/globalroutediscovery/globalroutediscovery_controller.go:306:81: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
pkg/controller/globalroutediscovery/globalroutediscovery_controller.go:311:101: conversion from int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
make: *** [vet] Error 2

This appears be a caused by a new warning in vet in go 1.15.

The offending code seems to be this: log.Error(err, "route's host not matching", "route[0]", route0.Route.Spec.Host, "route["+string(i)+"]", route.Route.Spec.Host)

More specifically, this code. "route["+string(i)+"]"