From 0cfefb242229077b8289525fac97cc1f715a0415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E6=81=92?= <2390904403@qq.com> Date: Wed, 3 Sep 2025 15:53:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- pkg/rpc/request.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0fa757d..d4d5460 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ import ( func main() { // 初始化 - rpc.InitiateRequest("127.0.0.1", 9631, "/root/cert.pem") + rpc.Initiate("127.0.0.1", 9631, "/root/cert.pem") // 获取设备详情 result, err := rpc.GetDevice().GetDetail(10001) if err != nil { diff --git a/pkg/rpc/request.go b/pkg/rpc/request.go index 845bf88..8e943ee 100644 --- a/pkg/rpc/request.go +++ b/pkg/rpc/request.go @@ -61,8 +61,8 @@ func (r *Request) Send(methodName string, body any, responseBody any) error { return nil } -// 初始化请求类 -func InitiateRequest(host string, port uint16, rootCertPath string) error { +// 初始化 +func Initiate(host string, port uint16, rootCertPath string) error { rootCert, err := os.ReadFile(rootCertPath) if err != nil { return fmt.Errorf("cert file read fail")