forked from security/hakurei
hst/fslink: improve string representation
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user