Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Go “如何修复”;语法错误:意外填充,应为逗号或“-”;链码?_Go_Hyperledger Fabric_Hyperledger Chaincode_Chaincode - Fatal编程技术网

Go “如何修复”;语法错误:意外填充,应为逗号或“-”;链码?

Go “如何修复”;语法错误:意外填充,应为逗号或“-”;链码?,go,hyperledger-fabric,hyperledger-chaincode,chaincode,Go,Hyperledger Fabric,Hyperledger Chaincode,Chaincode,我有链码,它应该加密数据,放入分类账并进行查询 我已经更新了结构二进制文件,但在其他结构示例链码中,这一行是相同的,没有任何错误 func(s*SmartContract)queryPatient(APIstub shim.ChaincodeStubInterface,args[]字符串)sc.Response{ 如果len(args)!=1{ 返回shim.Error(“参数数量不正确,应为1”) } patientAsBytes,err:=fc.Decrypter(APIstub,args[

我有链码,它应该加密数据,放入分类账并进行查询

我已经更新了结构二进制文件,但在其他结构示例链码中,这一行是相同的,没有任何错误

func(s*SmartContract)queryPatient(APIstub shim.ChaincodeStubInterface,args[]字符串)sc.Response{
如果len(args)!=1{
返回shim.Error(“参数数量不正确,应为1”)
}
patientAsBytes,err:=fc.Decrypter(APIstub,args[0])
如果错误!=零{
返回shim.Error(err.Error())
}
返回shim.Success(字节)
}
错误正指向
queryPatient(APIstub shim.ChaincodeStubInterface,args[]string)sc.Response{.
不知道sc.Response中的内容,但在所有情况下都返回了shim.Error()键入。根据术语存根,我认为您正在使用gRPC,它应该返回响应和错误。

此代码中的语法没有错误,因此它无法生成该错误。错误可能来自其他地方,或者实际代码不同。