aquasecurity / aquasecurity/table
content col span
- Dominant language
- Go
- Stars
- 132
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Hello. Can you give me examlpe, how can i use setColSpans function. I have panic, when use like this:
> t := table.New(os.Stdout)
> t.SetHeaders("Service", "Critical", "High", "Medium", "Low", "Unknown", "Last Scanned")
> t.AddRow("ec2", "1")
> t.AddRow("ec3")
> t.AddRow("ec2", "1")
> t.AddRow("eks", "7")
> t.SetColSpans(0, 1, 6)
> t.Render()
panic: runtime error: index out of range [7] with length 7
When use like this:
> t := table.New(os.Stdout)
> t.SetHeaders("Service", "Critical", "High", "Medium", "Low", "Unknown", "Last Scanned")
> t.AddRow("ec2", "1")
> t.AddRow("ec3")
> t.AddRow("ec2", "1")
> t.AddRow("eks", "7")
> t.SetColSpans(0, 1, 6)
> t.SetColSpans(1, 1, 6)
> t.Render()
i have:

But when use like this:
> t := table.New(os.Stdout)
> t.SetHeaders("Service", "Critical", "High", "Medium", "Low", "Unknown", "Last Scanned")
> t.AddRow("ec2", "1")
> t.AddRow("ec3")
> t.AddRow("ec2", "1")
> t.AddRow("eks", "7")
> t.SetColSpans(0, 1, 6)
> t.SetColSpans(1, 1, 6)
> t.SetColSpans(2, 1, 6)
> t.Render()
again panic:
panic: runtime error: index out of range [7] with length 7
Contributor guide
Research direction
Start by reproducing the provided Go snippets with SetColSpans and Render, then inspect those entry points to determine why the span exceeds the seven columns. Done means the examples no longer panic and the supported SetColSpans usage is clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100