Skip to content

Commit

Permalink
allocate ready-to-use slice of session in list cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
kkga committed Sep 16, 2021
1 parent 70fd7ff commit e0b95db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ func (c *ListCmd) Run() error {
Dir string `json:"dir"`
}

sessions := []session{}
sessions := make([]session, len(kakSessions))

for i, s := range kakSessions {
d, err := s.Dir()
sessions = append(sessions, session{Name: s.Name, Clients: []string{}, Dir: d})
sessions[i] = session{Name: s.Name, Clients: []string{}, Dir: d}

c, err := s.Clients()
for _, c := range c {
Expand Down

0 comments on commit e0b95db

Please sign in to comment.