aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmd
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-03-28 16:20:02 +0900
committerOphestra <cat@gensokyo.uk>2026-03-28 16:20:02 +0900
commit2c254c70b8838369a48c49f55a0346a7740f1514 (patch)
treec38fc2080c109c0c90b38c1fa2ce993773872bc1 /cmd
parentea014d6af2d1481ba05ffed2dddffeed370f6622 (diff)
cmd/hakurei: remove linkname directive
This used to be a function that did much more, and was later relocated to another package and exported. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/hakurei/command.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/cmd/hakurei/command.go b/cmd/hakurei/command.go
index 8f588654..b40b6b86 100644
--- a/cmd/hakurei/command.go
+++ b/cmd/hakurei/command.go
@@ -2,6 +2,7 @@ package main
import (
"context"
+ "errors"
"fmt"
"io"
"log"
@@ -11,7 +12,6 @@ import (
"strconv"
"sync"
"time"
- _ "unsafe" // for go:linkname
"hakurei.app/check"
"hakurei.app/command"
@@ -27,9 +27,12 @@ import (
// optionalErrorUnwrap calls [errors.Unwrap] and returns the resulting value
// if it is not nil, or the original value if it is.
-//
-//go:linkname optionalErrorUnwrap hakurei.app/container.optionalErrorUnwrap
-func optionalErrorUnwrap(err error) error
+func optionalErrorUnwrap(err error) error {
+ if underlyingErr := errors.Unwrap(err); underlyingErr != nil {
+ return underlyingErr
+ }
+ return err
+}
func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErrs, out io.Writer) command.Command {
var (