gotext

package module
v0.0.0-...-265ed61 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2021 License: MIT Imports: 2 Imported by: 6

README

text

GoDoc

Text utilities for Go. Particularly useful for writing code generators.

This package takes into account go lint's common initialisms and makes sure you don't generate a reserved word.

Install

go get -u github.com/matthewmueller/gotext

Thanks

Authors

License

MIT

Documentation

Overview

Package gotext is a wrapper over matthewmueller/text for generating go-compatible code. This means replacing keywords with valid alternatives and handling common acronyms that golint warns about.

One of the goals for this package is to have orthogonal functions. For example, text.Snake("Hi World") should return `Hi_World`, not `hi_word`. This can be challenging to pull off at times and I don't think we're quite there yet. Once we feel like we've reached the correct balance, I think it makes sense to pull out this package and make it available for everyone.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Camel

func Camel(s ...string) string

Camel case

func Lower

func Lower(s ...string) string

Lower case

func Pascal

func Pascal(s ...string) string

Pascal case

func Plural

func Plural(s ...string) string

Plural string

func Short

func Short(s ...string) string

Short case

func Singular

func Singular(s ...string) string

Singular string

func Slim

func Slim(s ...string) string

Slim string

func Slug

func Slug(s ...string) string

Slug case

func Snake

func Snake(s ...string) string

Snake case

func Space

func Space(s ...string) string

Space case

func Title

func Title(s ...string) string

Title case

func Unreserved

func Unreserved(s string) string

Unreserved returns an unreserved version of the word

func Upper

func Upper(s ...string) string

Upper case

Types

This section is empty.

Jump to

Keyboard shortcuts

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