aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/output.go
diff options
context:
space:
mode:
Diffstat (limited to 'container/output.go')
-rw-r--r--container/output.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/container/output.go b/container/output.go
new file mode 100644
index 00000000..6bedd55b
--- /dev/null
+++ b/container/output.go
@@ -0,0 +1,26 @@
+package container
+
+var msg Msg = new(DefaultMsg)
+
+func GetOutput() Msg { return msg }
+func SetOutput(v Msg) {
+ if v == nil {
+ msg = new(DefaultMsg)
+ } else {
+ msg = v
+ }
+}
+
+func wrapErrSuffix(err error, a ...any) error {
+ if err == nil {
+ return nil
+ }
+ return msg.WrapErr(err, append(a, err)...)
+}
+
+func wrapErrSelf(err error) error {
+ if err == nil {
+ return nil
+ }
+ return msg.WrapErr(err, err.Error())
+}