Skip to content

stone-payments/go-coveralls-api

 
 

Repository files navigation

go-coveralls-api

Coverage Status GoDoc

Client for Coveralls API written in Go.

Note: the goal is to interact with administrative Coveralls API. To send coverage data, take a look at goveralls project.

Installation

Just follow the usual instructions for Go libraries:

go get github.com/loadsmart/go-coveralls-api

go-coveralls-api uses Go Modules and therefore requires Go 1.11+.

Usage

To get the ID of a repo already configured in Coveralls

import (
    "context"
    "fmt"
    "log"

    "github.com/loadsmart/go-coveralls-api"
)

client := coveralls.NewClient("your-personal-access-token")
repository, err := client.Repositories.Get(context.Background(), "github", "user/repository")
if err != nil {
    log.Fatalf("Error querying Coveralls API: %s\n", err)
}

fmt.Printf("Project has ID %d in Coveralls", repository.ID)

Replace your-personal-access-token with your personal access token (can be found in your Coveralls account page).

License

This work is copyrighted to Loadsmart, Inc. and licensed under MIT. For details see LICENSE file.