aboutsummaryrefslogtreecommitdiffhomepage
path: root/system/output.go
blob: d431310de41686f791996f3dd7659ded43a5195e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package system

import (
	"git.gensokyo.uk/security/hakurei/container"
)

var msg container.Msg = new(container.DefaultMsg)

func SetOutput(v container.Msg) {
	if v == nil {
		msg = new(container.DefaultMsg)
	} else {
		msg = v
	}
}

func wrapErrSuffix(err error, a ...any) error {
	if err == nil {
		return nil
	}
	return msg.WrapErr(err, append(a, err)...)
}