https://github.com/zhiburt/gotestlint
Linter for golang(go).Which checks your functions is covered by tests or not.
https://github.com/zhiburt/gotestlint
go golang linter
Last synced: 3 months ago
JSON representation
Linter for golang(go).Which checks your functions is covered by tests or not.
- Host: GitHub
- URL: https://github.com/zhiburt/gotestlint
- Owner: zhiburt
- License: apache-2.0
- Created: 2019-02-23T18:58:29.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-04T13:41:21.000Z (over 7 years ago)
- Last Synced: 2024-06-20T16:47:08.186Z (about 2 years ago)
- Topics: go, golang, linter
- Language: Go
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://goreportcard.com/report/github.com/zhiburt/gotestlint)
[](https://godoc.org/github.com/zhiburt/gotestlint)
gotestlint is a linter for Go source code
it shows functions not had been covered by tests
## Usage
invoke gotestlint with one argument, that's path to package ```gotestlint``` doesn't go through your folders (don't recursive). The one checks only one package
```
$ gotestlint .
lint.go:20:function LintFiles is not covered any tests
lint.go:47:function String is not covered any tests
```
there's a recursive variant for it
```
gotestlint ./...
lint.go:27:function LintFiles is not covered any tests
```
It also can check only a bit files, something like this
```
gotestlint lint.go test_folder/test_folder.go
lint.go:20:function LintSource is not covered any tests
lint.go:27:function LintFiles is not covered any tests
lint.go:54:function String is not covered any tests
test_folder/test_folder.go:3:function SomeFunc is not covered any tests
...
```
if all functions are covered by tests,
it won't show any messages
```
$ gotestlint $GOPATH/src/github.com/your_the_best_project
```
you can add option ```nolint: gotestlint``` in comment your function
if function is marked such way, ```gotestlint``` ignores that function,
for example
```
// Foo ...
//
// nolint: gotestlint
func Foo(){
}
```