fix staticcheck ST1005 issues (follow error msg rules)

This commit is contained in:
kashitaka
2025-07-14 21:32:32 +09:00
committed by Martin Montes
parent 8008148c18
commit 2d52da0a15
29 changed files with 61 additions and 62 deletions

View File

@ -148,7 +148,7 @@ func (r *EndpointsReconciler) endpointSlice(ctx context.Context, key types.Names
func buildEndpoint(pod *corev1.Pod) (*discoveryv1.Endpoint, error) {
if pod.Status.PodIP == "" || pod.Spec.NodeName == "" {
return nil, errors.New("Pod IP and Nodename must be set")
return nil, errors.New("Pod IP and NodeName must be set") //nolint:staticcheck
}
return &discoveryv1.Endpoint{
Addresses: []string{pod.Status.PodIP},
@ -167,7 +167,7 @@ func buildEndpoint(pod *corev1.Pod) (*discoveryv1.Endpoint, error) {
func getAddressType(pod *corev1.Pod) (*discoveryv1.AddressType, error) {
if pod.Status.PodIP == "" {
return nil, errors.New("Pod IP and Nodename must be set")
return nil, errors.New("Pod IP and NodeName must be set") //nolint:staticcheck
}
parsedIp := net.ParseIP(pod.Status.PodIP)
if parsedIp == nil {