@@ -13,6 +13,7 @@ import (
1313 "github.com/wechaty/go-wechaty/wechaty-puppet/schemas"
1414 "google.golang.org/grpc"
1515 "google.golang.org/grpc/connectivity"
16+ "google.golang.org/grpc/credentials/insecure"
1617 "google.golang.org/protobuf/types/known/timestamppb"
1718 "io"
1819 "log"
@@ -237,7 +238,9 @@ func (p *PuppetService) startGrpcClient() error {
237238 }
238239 endpoint = serviceEndPoint .Target ()
239240 }
240- conn , err := grpc .Dial (endpoint , grpc .WithInsecure (), grpc .WithAuthority (p .Token ))
241+
242+ // TODO 支持 tls
243+ conn , err := grpc .Dial (endpoint , grpc .WithTransportCredentials (insecure .NewCredentials ()), grpc .WithAuthority (p .Token ))
241244 if err != nil {
242245 return err
243246 }
@@ -628,7 +631,7 @@ func (p *PuppetService) MessageRawPayload(id string) (*schemas.MessagePayload, e
628631 if response .ReceiveTime != nil {
629632 payload .Timestamp = grpcTimestampToGoTime (response .ReceiveTime )
630633 } else {
631- payload .Timestamp = time .Unix (int64 (response .TimestampDeprecated ), 0 )
634+ payload .Timestamp = time .Unix (int64 (response .TimestampDeprecated ), 0 ) //nolint:staticcheck
632635 }
633636 return payload , nil
634637}
@@ -786,7 +789,7 @@ func (p *PuppetService) MessageURL(messageID string) (*schemas.UrlLinkPayload, e
786789 if response .UrlLink == nil {
787790 // Deprecated: will be removed after Dec 31, 2022
788791 payload := & schemas.UrlLinkPayload {}
789- p .unMarshal (response .UrlLinkDeprecated , payload )
792+ p .unMarshal (response .UrlLinkDeprecated , payload ) //nolint:staticcheck
790793 return payload , nil
791794 }
792795
0 commit comments