thedevsaddam / gojsonq

A simple Go package for querying over JSON, YAML, XML, and CSV data.
https://github.com/thedevsaddam/gojsonq/wiki
MIT License
2.19k stars 140 forks source link

refactoring #18

Closed Kvaz1r closed 6 years ago

Kvaz1r commented 6 years ago

Fixed warnings which was found by go-critic linter

Corresponding log:

check-package: $GOPATH\src\github.com\thedevsaddam\gojsonq\helper.go:45:2: typeS witchVar: case 0 can benefit from type switch with assignment check-package: $GOPATH\src\github.com\thedevsaddam\gojsonq\helper.go:45:2: typeS witchVar: case 1 can benefit from type switch with assignment check-package: $GOPATH\src\github.com\thedevsaddam\gojsonq\helper.go:45:2: typeS witchVar: case 2 can benefit from type switch with assignment check-package: $GOPATH\src\github.com\thedevsaddam\gojsonq\helper.go:45:2: typeS witchVar: case 3 can benefit from type switch with assignment check-package: $GOPATH\src\github.com\thedevsaddam\gojsonq\helper.go:45:2: typeS witchVar: case 4 can benefit from type switch with assignment check-package: $GOPATH\src\github.com\thedevsaddam\gojsonq\helper.go:45:2: typeS witchVar: case 5 can benefit from type switch with assignment check-package: $GOPATH\src\github.com\thedevsaddam\gojsonq\helper.go:45:2: typeS witchVar: case 6 can benefit from type switch with assignment check-package: $GOPATH\src\github.com\thedevsaddam\gojsonq\jsonq.go:271:3: range ValCopy: each iteration copies 48 bytes (consider pointers or indexing) check-package: $GOPATH\src\github.com\thedevsaddam\gojsonq\jsonq.go:45:18: typeU nparen: could simplify to [][]query

coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 190


Totals Coverage Status
Change from base Build 187: 0.0%
Covered Lines: 768
Relevant Lines: 768

💛 - Coveralls
thedevsaddam commented 6 years ago

Why replacerange with for loop? You must create an issue regarding this refactor before sending PR.

https://github.com/thedevsaddam/gojsonq/blob/master/CONTRIBUTING.md