Made corrections to satisfy linter.

This commit is contained in:
2022-10-14 19:51:19 +02:00
parent 8e2ba58ddb
commit 745d15b459
10 changed files with 39 additions and 34 deletions

View File

@@ -52,13 +52,13 @@ var (
// colors to be used per supported color mode
Colors = map[color.Level]map[string]string{
color.Level16: map[string]string{
color.Level16: {
"bg": "green", "fg": "black",
},
color.Level256: map[string]string{
color.Level256: {
"bg": "lightGreen", "fg": "black",
},
color.LevelRgb: map[string]string{
color.LevelRgb: {
// FIXME: maybe use something nicer
"bg": "lightGreen", "fg": "black",
},
@@ -68,7 +68,7 @@ var (
validOutputmodes = "(orgtbl|markdown|extended|ascii)"
// main program version
Version = "v1.0.8"
Version = "v1.0.9"
// generated version string, used by -v contains lib.Version on
// main branch, and lib.Version-$branch-$lastcommit-$date on

View File

@@ -87,7 +87,7 @@ func reduceColumns(data *Tabdata) {
// exclude columns, if any
if len(Columns) > 0 {
reducedEntries := [][]string{}
reducedEntry := []string{}
var reducedEntry []string
for _, entry := range data.entries {
reducedEntry = nil
for i, value := range entry {

View File

@@ -79,15 +79,15 @@ func TestReduceColumns(t *testing.T) {
columns []int
}{
{
expect: [][]string{[]string{"a", "b"}},
expect: [][]string{{"a", "b"}},
columns: []int{1, 2},
},
{
expect: [][]string{[]string{"a", "c"}},
expect: [][]string{{"a", "c"}},
columns: []int{1, 3},
},
{
expect: [][]string{[]string{"a"}},
expect: [][]string{{"a"}},
columns: []int{1},
},
{
@@ -96,7 +96,7 @@ func TestReduceColumns(t *testing.T) {
},
}
input := [][]string{[]string{"a", "b", "c"}}
input := [][]string{{"a", "b", "c"}}
Columns = "y" // used as a flag with len(Columns)...

View File

@@ -35,10 +35,10 @@ func TestParser(t *testing.T) {
"ONE", "TWO", "THREE",
},
entries: [][]string{
[]string{
{
"asd", "igig", "cxxxncnc",
},
[]string{
{
"19191", "EDD 1", "X",
},
},
@@ -69,7 +69,7 @@ func TestParserPatternmatching(t *testing.T) {
}{
{
entries: [][]string{
[]string{
{
"asd", "igig", "cxxxncnc",
},
},
@@ -78,7 +78,7 @@ func TestParserPatternmatching(t *testing.T) {
},
{
entries: [][]string{
[]string{
{
"19191", "EDD 1", "X",
},
},

View File

@@ -52,10 +52,10 @@ func TestPrinter(t *testing.T) {
"ONE", "TWO", "THREE",
},
entries: [][]string{
[]string{
{
"asd", "igig", "cxxxncnc",
},
[]string{
{
"19191", "EDD 1", "X",
},
},
@@ -100,7 +100,9 @@ THREE(3): X`,
t.Run(testname, func(t *testing.T) {
OutputMode = mode
data := startdata // we need to reset our mock data, since it's being modified in printData()
// we need to reset our mock data, since it's being
// modified in printData()
data := startdata
printData(&data)
buf := make([]byte, 1024)
@@ -136,13 +138,13 @@ func TestSortPrinter(t *testing.T) {
"ONE", "TWO", "THREE",
},
entries: [][]string{
[]string{
{
"abc", "345", "b1",
},
[]string{
{
"bcd", "234", "a2",
},
[]string{
{
"cde", "123", "c3",
},
},