The purpose of text
is to provide string utilities, but with special considerations relating to web-service(s),
cloud providers, and external APIs.
Interfacing with packages such as AWS and Stripe GO SDKs often require working with pointer inputs and outputs. Such cases can result in undesired, unexpected behavior. When writing API services, tracing issues can become difficult.
That's where the text
package's variadic options are perhaps the most notable; configurations
can be set that will log unexpected nil or zeroth input arguments.
Official godoc
documentation (with examples) can be found at the Package Registry.
go get -u github.com/x-ethr/text
main.go
package main
import (
"github.com/x-ethr/text"
)
func main() {
const example = "v-value"
ptr := text.Pointer(example) // initialize ptr as a reference to example
// --> optionally construct text.Options for logging
ptr = text.Pointer(example, text.Variadic(o text.Options) {
o.Log = true // output a warning if string is empty
})
...
}
- Please refer to the code examples for additional usage and implementation details.
- See https://pkg.go.dev/github.com/x-ethr/text for additional documentation.
See the Contributing Guide for additional details on getting started.