Files
hakurei/internal/path.go
Ophestra 87e008d56d treewide: rename to hakurei
Fortify makes little sense for a container tool.

Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-06-25 04:57:41 +09:00

24 lines
413 B
Go

package internal
import (
"log"
"path"
"git.gensokyo.uk/security/hakurei/internal/hlog"
)
var (
hsu = compPoison
)
func MustHsuPath() string {
if name, ok := checkPath(hsu); ok {
return name
}
hlog.BeforeExit()
log.Fatal("invalid hsu path, this program is compiled incorrectly")
return compPoison
}
func checkPath(p string) (string, bool) { return p, p != compPoison && p != "" && path.IsAbs(p) }