get rid of unserializable error type.

This commit is contained in:
Raúl Kripalani
2021-08-04 19:36:56 +01:00
parent 5f49101566
commit edcd2f34d4
6 changed files with 19 additions and 9 deletions
+2 -2
View File
@@ -355,12 +355,12 @@ type DealSchedule struct {
type DagstoreShardInfo struct {
Key string
State string
Error error
Error string
}
// DagstoreGCResult is the serialized form of dagstore.GCResult that we expose
// through JSON-RPC to avoid clients having to depend on the dagstore lib.
type DagstoreGCResult struct {
Key string
Error error
Error string
}
+1 -1
View File
@@ -76,7 +76,7 @@ func TestReturnTypes(t *testing.T) {
seen[typ] = struct{}{}
if typ.Kind() == reflect.Interface && typ != bareIface && !typ.Implements(jmarsh) {
t.Error("methods can't return interfaces", m.Name)
t.Error("methods can't return interfaces or struct types not implementing json.Marshaller", m.Name)
}
switch typ.Kind() {
+2 -2
View File
@@ -278,12 +278,12 @@ func init() {
})
addExample(api.DagstoreGCResult{
Key: "baga6ea4seaqecmtz7iak33dsfshi627abz4i4665dfuzr3qfs4bmad6dx3iigdq",
Error: nil,
Error: "<error>",
})
addExample(api.DagstoreShardInfo{
Key: "baga6ea4seaqecmtz7iak33dsfshi627abz4i4665dfuzr3qfs4bmad6dx3iigdq",
State: "ShardStateAvailable",
Error: nil,
Error: "<error>",
})
}