diff options
| author | Paul Buetow <paul@buetow.org> | 2024-03-02 14:52:23 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-03-02 14:52:23 +0200 |
| commit | 89f861d778d8bf6e053d3ed6b60df2455dcb60fb (patch) | |
| tree | 89fe11ea0db1d26529a58f0d80ab66369c8f0360 /internal/file.go | |
| parent | b941cec01a9dfb29903b9e55369073df5c283a52 (diff) | |
can print old and newname
Diffstat (limited to 'internal/file.go')
| -rw-r--r-- | internal/file.go | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/internal/file.go b/internal/file.go index 069e68f..81fe43d 100644 --- a/internal/file.go +++ b/internal/file.go @@ -5,12 +5,16 @@ import ( "strings" ) -type file struct { +type file interface { + String() string +} + +type fdFile struct { fd int32 name string } -func (f file) String() string { +func (f fdFile) String() string { var sb strings.Builder if len(f.name) == 0 { @@ -24,3 +28,18 @@ func (f file) String() string { return sb.String() } + +type oldnameNewnameFile struct { + oldname, newname string +} + +func (f oldnameNewnameFile) String() string { + var sb strings.Builder + + sb.WriteString("old:") + sb.WriteString(f.oldname) + sb.WriteString(" ->new:") + sb.WriteString(f.newname) + + return sb.String() +} |
