#!/usr/bin/env bash
# This example uses grep in a way that is compatible with both Linux and macOS.
coverage=$(gocoverstats -v -f coverage.txt | grep -v "Global, unweighted" | tr -s '[:blank:]' ',')
for package in $coverage; do
	IFS=,
	read TAG RATIO <<< "${package}"
	dog metrics post foo_project.coverage "${RATIO}" --tags package:"${TAG}"
done
