diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7509ae7..71de403 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,14 @@ jobs: with: go-version: '1.21' - name: Test all - run: go version && go mod tidy && go test -v ./... + run: go version && go mod tidy && go test -v -covermode=count -coverprofile=coverage.out ./... + - name: Upload coverage to Coveralls + uses: coverallsapp/github-action@v2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + # If your repo is private, uncomment the next line and set the secret + # coveralls-token: ${{ secrets.COVERALLS_REPO_TOKEN }} + path-to-lcov: coverage.out #all-tests-windows: # name: Run all tests on windows diff --git a/README.md b/README.md index fb19d41..fb88c9d 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,12 @@ # Wissance/StringFormatter +[![Awesome Package](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go) ![GitHub go.mod Go version (subdirectory of monorepo)](https://img.shields.io/github/go-mod/go-version/wissance/stringFormatter?style=plastic) ![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/wissance/stringFormatter?style=plastic) ![GitHub issues](https://img.shields.io/github/issues/wissance/stringFormatter?style=plastic) ![GitHub Release Date](https://img.shields.io/github/release-date/wissance/stringFormatter) -[![Wissance.WebApiToolkit CI](https://github.com/Wissance/stringFormatter/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Wissance/stringFormatter/actions/workflows/ci.yml) +[![Wissance.StringFormatter CI](https://github.com/Wissance/stringFormatter/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/Wissance/stringFormatter/actions/workflows/ci.yml) +[![Go Report Card](https://goreportcard.com/badge/github.com/wissance/stringFormatter)](https://goreportcard.com/report/github.com/wissance/stringFormatter) +[![Coverage Status](https://coveralls.io/repos/github/Wissance/stringFormatter/badge.svg?branch=master)](https://coveralls.io/github/Wissance/stringFormatter?branch=master) ![String Formatter: a convenient string formatting tool](img/sf_logo_sm.png) @@ -13,6 +16,11 @@ 3. Use for **template-based src code generator** 4. Other text proccessing +Other important resources: +* [Go Report Card A+](https://goreportcard.com/report/github.com/wissance/stringFormatter) +* [Coverage > 80%](https://coveralls.io/github/Wissance/stringFormatter) + + ## ✨ 1 Features 🔤 Flexible Syntax: Supports both indexed / positional (`{0}`) and named (`{user}`) *placeholders* in templates. diff --git a/maptostring.go b/maptostring.go index d16d665..6fb80f5 100644 --- a/maptostring.go +++ b/maptostring.go @@ -12,7 +12,7 @@ const ( // MapToString - format map keys and values according to format, joining parts with separator. // Format should contain key and value placeholders which will be used for formatting, e.g. // "{key} : {value}", or "{value}", or "{key} => {value}". -// Parts order in resulting string is not guranteed. +// Parts order in resulting string is not guaranteed. func MapToString[ K string | int | uint | int32 | int64 | uint32 | uint64, V any,