Parcourir la source

优化修改代码注释和重新打包

niujiuru il y a 1 semaine
Parent
commit
393ca73b7b

BIN
package/rtu_linux_modules_1.0.0.1.tar.gz


BIN
package/yfkj_ssh_client_1.0.0.1.tar.gz


+ 2 - 2
utils/jsonrpc2/rpc.go

@@ -125,7 +125,7 @@ func ParseResponse(input any) (*Response, error) {
 
 	// 情况 4:错误时的应答 → 必须有id&且不能空
 	if resp.Error != nil && resp.Error.Code == ErrParse { // 当发生解析错误时, "id"必须为: nil
-		/*if resp.ID != nil { // 虽然更符合规范, 但老版本请求有的会返回ErrParse, 为了兼容, 暂不启用
+		/*if resp.ID != nil { // 虽然更符合规范, 但编程时有的应答会返回ErrParse, 为了兼容, 暂不启用
 			return nil, errors.New(`"id" must be null for parse error`)
 		}*/
 		return &resp, nil
@@ -242,7 +242,7 @@ func BuildError(req *Request, code ErrCode, message string) *Response {
 
 	/*if code == ErrParse {
 		id = nil
-	}*/ // 虽然更符合规范, 但老版本应答有的会使用ErrParse, 为了兼容, 暂不启用
+	}*/ // 虽然更符合规范, 但编程时code可能会使用ErrParse, 为了兼容, 暂不启用
 
 	emsg := message
 	if emsg == "" {