Skip to content

Commit

Permalink
fix some linting failures
Browse files Browse the repository at this point in the history
  • Loading branch information
dklimpel committed May 31, 2024
1 parent e8ae554 commit d7c3b59
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 12 deletions.
3 changes: 1 addition & 2 deletions matchers/type_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"strconv"
"strings"

Expand Down Expand Up @@ -108,7 +107,7 @@ func (t ReaderToString) Transform(i interface{}) (interface{}, error) {
return nil, fmt.Errorf("Expected io.reader, Got:%s", format.Object(i, 1))
}

b, err := ioutil.ReadAll(r)
b, err := io.ReadAll(r)
if err != nil {
return "", err
}
Expand Down
3 changes: 1 addition & 2 deletions outputs/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ func (r Json) ValidOptions() []*formatOption {
func (r Json) Output(w io.Writer, results <-chan []resource.TestResult,
outConfig util.OutputConfig) (exitCode int) {

var pretty bool
pretty = util.IsValueInList(foPretty, outConfig.FormatOptions)
var pretty bool = util.IsValueInList(foPretty, outConfig.FormatOptions)
includeRaw := !util.IsValueInList(foExcludeRaw, outConfig.FormatOptions)

sort := util.IsValueInList(foSort, outConfig.FormatOptions)
Expand Down
3 changes: 1 addition & 2 deletions outputs/junit.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ func (r JUnit) Output(w io.Writer, results <-chan []resource.TestResult,
// ISO8601 timeformat
timestamp := time.Now().Format(time.RFC3339)

var summary map[int]string
summary = make(map[int]string)
var summary map[int]string = make(map[int]string)

var startTime time.Time
var endTime time.Time
Expand Down
3 changes: 1 addition & 2 deletions outputs/nagios.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ func (r Nagios) Output(w io.Writer, results <-chan []resource.TestResult,

var startTime time.Time
var endTime time.Time
var summary map[int]string
summary = make(map[int]string)
var summary map[int]string = make(map[int]string)

for resultGroup := range results {
for _, testResult := range resultGroup {
Expand Down
3 changes: 1 addition & 2 deletions outputs/tap.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ func (r Tap) Output(w io.Writer, results <-chan []resource.TestResult,
testCount := 0
failed := 0

var summary map[int]string
summary = make(map[int]string)
var summary map[int]string = make(map[int]string)

for resultGroup := range results {
for _, testResult := range resultGroup {
Expand Down
2 changes: 1 addition & 1 deletion system/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func realPath(path string) (string, error) {
if f == "~" {
usr, err = user.Current()
} else {
usr, err = user.Lookup(f[1:len(f)])
usr, err = user.Lookup(f[1:])
}
if err != nil {
return "", err
Expand Down
2 changes: 1 addition & 1 deletion util/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func ValidateSections(unmarshal func(any) error, i any, whitelist map[string]boo
typ := reflect.TypeOf(i)
typs := strings.Split(typ.String(), ".")[1]
for id, v := range toValidate {
for k, _ := range v {
for k := range v {
if !whitelist[k] {
return fmt.Errorf("invalid Attribute for %s:%s: %s", typs, id, k)
}
Expand Down

0 comments on commit d7c3b59

Please sign in to comment.