Displaying 1 result from an estimated 1 matches for "e11967d57".
2020 Feb 19
1
[PATCH] golang: make API idiomatic so that functions return (<val>, error)
...functions return can be
a *GuestfsError, but the function signature should have (<val>, error)
as return value.
---
generator/golang.ml | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/generator/golang.ml b/generator/golang.ml
index bd09ae9cf..e11967d57 100644
--- a/generator/golang.ml
+++ b/generator/golang.ml
@@ -114,6 +114,11 @@ func (e *GuestfsError) String() string {
}
}
+/* Implement the error interface */
+func (e *GuestfsError) Error() string {
+ return e.String()
+}
+
func get_error_from_handle (g *Guestfs, op string) *Guestfs...