Skip to content

Commit

Permalink
fix table
Browse files Browse the repository at this point in the history
  • Loading branch information
fmhr committed Sep 17, 2023
1 parent 28b2a2e commit 76ced57
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions table.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package fj

import (
"os"
"slices"

Check failure on line 5 in table.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 1.19)

package slices is not in GOROOT (/opt/hostedtoolcache/go/1.19.13/x64/src/slices)

Check failure on line 5 in table.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest, 1.20)

package slices is not in GOROOT (/opt/hostedtoolcache/go/1.20.8/x64/src/slices)
"sort"
"strconv"

Expand All @@ -17,6 +18,11 @@ func DisplayTabel(data []map[string]float64) {
for key := range data[0] {
headers = append(headers, key)
}
seedIndex := slices.Index(headers, "seed")
if seedIndex != 0 {
headers[0], headers[seedIndex] = headers[seedIndex], headers[0]
}
sort.Strings(headers[1:])
table.SetHeader(headers)
}

Expand Down

0 comments on commit 76ced57

Please sign in to comment.