mirror of
https://github.com/hyperledger/fabric-samples.git
synced 2026-06-22 09:35:10 +00:00
Merge "[FAB-16668] fabcar chaincode modify console output"
This commit is contained in:
commit
333dbd0baa
2 changed files with 8 additions and 9 deletions
|
|
@ -152,18 +152,16 @@ func (s *SmartContract) queryAllCars(APIstub shim.ChaincodeStubInterface) pb.Res
|
||||||
return shim.Error(err.Error())
|
return shim.Error(err.Error())
|
||||||
}
|
}
|
||||||
// Add a comma before array members, suppress it for the first array member
|
// Add a comma before array members, suppress it for the first array member
|
||||||
if bArrayMemberAlreadyWritten == true {
|
if bArrayMemberAlreadyWritten {
|
||||||
buffer.WriteString(",")
|
buffer.WriteString(",")
|
||||||
}
|
}
|
||||||
buffer.WriteString("{\"Key\":")
|
|
||||||
buffer.WriteString("\"")
|
|
||||||
buffer.WriteString(queryResponse.Key)
|
|
||||||
buffer.WriteString("\"")
|
|
||||||
|
|
||||||
buffer.WriteString(", \"Record\":")
|
buffer.WriteString(
|
||||||
// Record is a JSON object, so we write as-is
|
fmt.Sprintf(
|
||||||
buffer.WriteString(string(queryResponse.Value))
|
`{"Key":"%s", "Record":%s}`,
|
||||||
buffer.WriteString("}")
|
queryResponse.Key, queryResponse.Value,
|
||||||
|
),
|
||||||
|
)
|
||||||
bArrayMemberAlreadyWritten = true
|
bArrayMemberAlreadyWritten = true
|
||||||
}
|
}
|
||||||
buffer.WriteString("]")
|
buffer.WriteString("]")
|
||||||
|
|
|
||||||
|
|
@ -8,5 +8,6 @@ require (
|
||||||
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 // indirect
|
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 // indirect
|
||||||
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // indirect
|
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // indirect
|
||||||
golang.org/x/text v0.3.2 // indirect
|
golang.org/x/text v0.3.2 // indirect
|
||||||
|
google.golang.org/appengine v1.4.0 // indirect
|
||||||
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect
|
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue