From 2ae3adec224d7772330ef4bb109cb0426e4d29e6 Mon Sep 17 00:00:00 2001 From: BabyHalimao Date: Sat, 1 Jun 2024 14:29:48 +0800 Subject: [PATCH 1/2] refactor: don't use nil panic --- tools/hubl/internal/compat.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/hubl/internal/compat.go b/tools/hubl/internal/compat.go index b67e7adfd8ba..28c7ba622a2c 100644 --- a/tools/hubl/internal/compat.go +++ b/tools/hubl/internal/compat.go @@ -59,7 +59,7 @@ func loadFileDescriptorsGRPCReflection(ctx context.Context, client *grpc.ClientC switch res := in.MessageResponse.(type) { case *grpc_reflection_v1alpha.ServerReflectionResponse_ErrorResponse: - panic(err) + panic(res.ErrorResponse.String()) case *grpc_reflection_v1alpha.ServerReflectionResponse_ListServicesResponse: waitListServiceRes <- res.ListServicesResponse //nolint:staticcheck // we want to use the deprecated field case *grpc_reflection_v1alpha.ServerReflectionResponse_FileDescriptorResponse: From afb6e596c7ce472c554bd659a0a43ee7fa5aa5a2 Mon Sep 17 00:00:00 2001 From: BabyHalimao Date: Sat, 1 Jun 2024 14:34:16 +0800 Subject: [PATCH 2/2] lint: fix lint error --- tools/hubl/internal/compat.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/hubl/internal/compat.go b/tools/hubl/internal/compat.go index 28c7ba622a2c..736ff1f1414f 100644 --- a/tools/hubl/internal/compat.go +++ b/tools/hubl/internal/compat.go @@ -59,7 +59,7 @@ func loadFileDescriptorsGRPCReflection(ctx context.Context, client *grpc.ClientC switch res := in.MessageResponse.(type) { case *grpc_reflection_v1alpha.ServerReflectionResponse_ErrorResponse: - panic(res.ErrorResponse.String()) + panic(res.ErrorResponse.String()) //nolint:staticcheck // we want to use the deprecated field case *grpc_reflection_v1alpha.ServerReflectionResponse_ListServicesResponse: waitListServiceRes <- res.ListServicesResponse //nolint:staticcheck // we want to use the deprecated field case *grpc_reflection_v1alpha.ServerReflectionResponse_FileDescriptorResponse: