diff --git a/channelz/service/func_linux.go b/channelz/service/func_linux.go index 192c3a1f..cfa457a6 100644 --- a/channelz/service/func_linux.go +++ b/channelz/service/func_linux.go @@ -21,11 +21,18 @@ package service import ( + "time" + "github.com/golang/protobuf/ptypes" + durpb "github.com/golang/protobuf/ptypes/duration" channelzpb "google.golang.org/grpc/channelz/grpc_channelz_v1" "google.golang.org/grpc/internal/channelz" ) +func convertToPtypesDuration(sec int64, usec int64) *durpb.Duration { + return ptypes.DurationProto(time.Duration(sec*1e9 + usec*1e3)) +} + func sockoptToProto(skopts *channelz.SocketOptionData) []*channelzpb.SocketOption { var opts []*channelzpb.SocketOption if skopts.Linger != nil { diff --git a/channelz/service/service.go b/channelz/service/service.go index 0fad08f9..c8174e5e 100644 --- a/channelz/service/service.go +++ b/channelz/service/service.go @@ -24,10 +24,8 @@ package service import ( "context" "net" - "time" "github.com/golang/protobuf/ptypes" - durpb "github.com/golang/protobuf/ptypes/duration" wrpb "github.com/golang/protobuf/ptypes/wrappers" "google.golang.org/grpc" channelzgrpc "google.golang.org/grpc/channelz/grpc_channelz_v1" @@ -43,10 +41,6 @@ func init() { channelz.TurnOn() } -func convertToPtypesDuration(sec int64, usec int64) *durpb.Duration { - return ptypes.DurationProto(time.Duration(sec*1e9 + usec*1e3)) -} - // RegisterChannelzServiceToServer registers the channelz service to the given server. func RegisterChannelzServiceToServer(s *grpc.Server) { channelzgrpc.RegisterChannelzServer(s, newCZServer())