Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Golang's coverage? #58

Open
shackra opened this issue May 29, 2024 · 0 comments
Open

Support for Golang's coverage? #58

shackra opened this issue May 29, 2024 · 0 comments

Comments

@shackra
Copy link

shackra commented May 29, 2024

I wish for golang support of the code coverage format, it looks like this:

mode: set
github.com/shackra/keisy-ian/app/bot-trader/app.go:20.89,22.28 2 0
github.com/shackra/keisy-ian/app/bot-trader/app.go:22.28,24.3 1 0
github.com/shackra/keisy-ian/app/bot-trader/app.go:26.2,50.16 4 0
github.com/shackra/keisy-ian/app/bot-trader/app.go:50.16,52.3 1 0
github.com/shackra/keisy-ian/app/bot-trader/app.go:54.2,60.8 2 0
github.com/shackra/keisy-ian/app/bot-trader/app.go:63.49,68.12 4 0
github.com/shackra/keisy-ian/app/bot-trader/app.go:68.12,69.7 1 0
github.com/shackra/keisy-ian/app/bot-trader/app.go:69.7,70.11 1 0
github.com/shackra/keisy-ian/app/bot-trader/app.go:71.22,72.11 1 0
github.com/shackra/keisy-ian/app/bot-trader/app.go:73.22,80.6 1 0
github.com/shackra/keisy-ian/app/bot-trader/app.go:81.15,81.15 0 0
github.com/shackra/keisy-ian/app/bot-trader/app.go:86.2,86.19 1 0
github.com/shackra/keisy-ian/app/bot-trader/configuration_options.go:23.49,24.25 1 0
github.com/shackra/keisy-ian/app/bot-trader/configuration_options.go:24.25,26.3 1 0
github.com/shackra/keisy-ian/app/bot-trader/configuration_options.go:29.50,30.25 1 0
github.com/shackra/keisy-ian/app/bot-trader/configuration_options.go:30.25,32.3 1 0
github.com/shackra/keisy-ian/app/bot-trader/configuration_options.go:35.58,36.25 1 0
github.com/shackra/keisy-ian/app/bot-trader/configuration_options.go:36.25,38.3 1 0
github.com/shackra/keisy-ian/app/bot-trader/configuration_options.go:41.57,42.25 1 0
github.com/shackra/keisy-ian/app/bot-trader/configuration_options.go:42.25,44.3 1 0
github.com/shackra/keisy-ian/app/bot-trader/configuration_options.go:47.53,48.25 1 0
github.com/shackra/keisy-ian/app/bot-trader/configuration_options.go:48.25,50.3 1 0
github.com/shackra/keisy-ian/app/bot-trader/configuration_options.go:53.55,54.25 1 0
github.com/shackra/keisy-ian/app/bot-trader/configuration_options.go:54.25,56.3 1 0
github.com/shackra/keisy-ian/app/bot-trader/configuration_options.go:59.59,60.25 1 0
github.com/shackra/keisy-ian/app/bot-trader/configuration_options.go:60.25,62.3 1 0
github.com/shackra/keisy-ian/app/bot-trader/configuration_options.go:65.64,66.25 1 0
github.com/shackra/keisy-ian/app/bot-trader/configuration_options.go:66.25,68.3 1 0
github.com/shackra/keisy-ian/internal/model/models.go:44.87,55.2 2 0
github.com/shackra/keisy-ian/internal/model/models.go:57.37,59.2 1 0
github.com/shackra/keisy-ian/internal/model/models.go:66.50,73.2 2 1
github.com/shackra/keisy-ian/internal/model/models.go:75.57,82.2 2 1
github.com/shackra/keisy-ian/internal/model/models.go:84.61,91.2 2 1
# ...

With go list -m -json we can guess what part is the name of the module and what's the package:

➜  go list -m -json
{
        "Path": "github.com/shackra/keisy-ian",
        "Main": true,
        "Dir": "/home/jorge/code/crypto/robot-trader/keisy-ian",
        "GoMod": "/home/jorge/code/crypto/robot-trader/keisy-ian/go.mod",
        "GoVersion": "1.21.0"
}

Among many other values.

The format is as follows (taken from a tool that converts this format to lcov):

// Format being parsed is:
//
//	name.go:line.column,line.column numberOfStatements count
//
// e.g.
//
//	github.com/jandelgado/golang-ci-template/main.go:6.14,8.2 1 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant