1
0
forked from rosa/hakurei

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>
This commit is contained in:
2026-03-28 16:20:02 +09:00
parent ea014d6af2
commit 2c254c70b8

View File

@@ -2,6 +2,7 @@ package main
import ( import (
"context" "context"
"errors"
"fmt" "fmt"
"io" "io"
"log" "log"
@@ -11,7 +12,6 @@ import (
"strconv" "strconv"
"sync" "sync"
"time" "time"
_ "unsafe" // for go:linkname
"hakurei.app/check" "hakurei.app/check"
"hakurei.app/command" "hakurei.app/command"
@@ -27,9 +27,12 @@ import (
// optionalErrorUnwrap calls [errors.Unwrap] and returns the resulting value // optionalErrorUnwrap calls [errors.Unwrap] and returns the resulting value
// if it is not nil, or the original value if it is. // if it is not nil, or the original value if it is.
// func optionalErrorUnwrap(err error) error {
//go:linkname optionalErrorUnwrap hakurei.app/container.optionalErrorUnwrap if underlyingErr := errors.Unwrap(err); underlyingErr != nil {
func optionalErrorUnwrap(err error) error return underlyingErr
}
return err
}
func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErrs, out io.Writer) command.Command { func buildCommand(ctx context.Context, msg message.Msg, early *earlyHardeningErrs, out io.Writer) command.Command {
var ( var (