https://github.com/spatialcurrent/go-stringify
Go function to stringify map keys.
https://github.com/spatialcurrent/go-stringify
go golang
Last synced: 6 days ago
JSON representation
Go function to stringify map keys.
- Host: GitHub
- URL: https://github.com/spatialcurrent/go-stringify
- Owner: spatialcurrent
- License: mit
- Created: 2019-04-14T23:44:08.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2022-03-08T15:36:04.000Z (almost 4 years ago)
- Last Synced: 2025-08-15T10:43:02.007Z (6 months ago)
- Topics: go, golang
- Language: Go
- Homepage: https://pkg.go.dev/github.com/spatialcurrent/go-stringify
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
[](https://circleci.com/gh/spatialcurrent/go-stringify/tree/main)
[](https://goreportcard.com/report/github.com/spatialcurrent/go-stringify)
[](https://pkg.go.dev/github.com/spatialcurrent/go-stringify)
[](https://github.com/spatialcurrent/go-stringify/blob/master/LICENSE)
# go-stringify
# Description
**go-stringify** is a simple library for generating a stringer that converts literals to strings, converts map keys to strings, or converts a slice to a slice of strings. **go-stringify** is used by [go-simple-serializer](http://github.com/spatialcurrent/go-simple-serializer).
# Usage
**Go**
You can import **go-stringify** as a library with:
```go
import (
"github.com/spatialcurrent/go-stringify/pkg/stringify"
)
```
The easiest pattern is to use the `NewStringer(noDataValue string, decimal bool, lower bool, upper bool)` constructor to create a stringer function.
```go
stringer := NewStringer("-", true, false, false)
...
str := stringer(obj)
```
See [stringify](https://pkg.go.dev/github.com/spatialcurrent/go-stringify/pkg/stringify) in the docs for information on how to use Go API.
# Testing
To run Go tests using `make test_go` or (`bash scripts/test.sh`), which runs unit tests, `go vet`, `go vet with shadow`, [errcheck](https://github.com/kisielk/errcheck), [staticcheck](https://staticcheck.io/), and [misspell](https://github.com/client9/misspell).
# Contributing
[Spatial Current, Inc.](https://spatialcurrent.io) is currently accepting pull requests for this repository. We'd love to have your contributions! Please see [Contributing.md](https://github.com/spatialcurrent/go-stringify/blob/main/CONTRIBUTING.md) for how to get started.
# License
This work is distributed under the **MIT License**. See **LICENSE** file.