go-stringify

module
v0.0.0-...-0abf902 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2022 License: MIT

README

CircleCI Go Report Card PkgGoDev 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.

Usage

Go

You can import go-stringify as a library with:

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.

stringer := NewStringer("-", true, false, false)
...
str := stringer(obj)

See 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, staticcheck, and misspell.

Contributing

Spatial Current, Inc. is currently accepting pull requests for this repository. We'd love to have your contributions! Please see Contributing.md for how to get started.

License

This work is distributed under the MIT License. See LICENSE file.

Directories

Path Synopsis
pkg
stringify
Package 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.
Package 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL