hst/fslink: improve string representation
All checks were successful
Test / Create distribution (push) Successful in 35s
Test / Sandbox (push) Successful in 2m7s
Test / Hakurei (push) Successful in 3m14s
Test / Hpkg (push) Successful in 4m1s
Test / Sandbox (race detector) (push) Successful in 4m29s
Test / Hakurei (race detector) (push) Successful in 5m9s
Test / Flake checks (push) Successful in 1m25s

This shortens the representation of most common use cases and generally improves readability.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-08-25 22:52:48 +09:00
parent 9585b35d5b
commit c328b584c0
3 changed files with 26 additions and 10 deletions

View File

@@ -50,9 +50,12 @@ func (l *FSLink) String() string {
return "<invalid>"
}
dereference := ""
var dereference string
if l.Dereference {
if l.Target.String() == l.Linkname {
return l.Target.String() + "@"
}
dereference = "*"
}
return "&" + l.Target.String() + ":" + dereference + l.Linkname
return l.Target.String() + " -> " + dereference + l.Linkname
}