Skip to content

Commit

Permalink
fds: make String() concurrency-safe
Browse files Browse the repository at this point in the history
  • Loading branch information
natasha-jarus committed Sep 26, 2024
1 parent bd0e378 commit 47e6f1d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions fds.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,10 @@ type Fds struct {
l log15.Logger
}

func (f *Fds) String() string {
res := make([]string, 0, len(f.fds))
for _, fi := range f.fds {
func (f *Fds) String() string { // XXX here?
fds := f.copy()
res := make([]string, 0, len(fds))
for _, fi := range fds {
res = append(res, fi.String())
}
return fmt.Sprintf("fds: %v", res)
Expand Down

0 comments on commit 47e6f1d

Please sign in to comment.