mixedcase

package module
v0.0.0-...-5348215 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2016 License: MIT Imports: 4 Imported by: 1

README

mixedcase

GoDocBuild Status

MixedCase converts snake_case identifiers to MixedCase or mixedCase identifiers. It will also ensure that the identifiers do not start with invalid characters; converting numeric characters, [0-9], to their word equivalent and discarding invalid start characters. Common initialisms are Upper Cased unless they begin a mixedCase identifier, which are lower cased.

The resulting string is a valid Go identifier.

Initialisms

Currently, initialisms do not cover all possible initialisms; just the ones present in Go's linter.

Documentation

Overview

Copyright (c) 2016, Joel Scoble. All rights reserved.

Use of this source code is governed by the MIT license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exported

func Exported(s string) string

Exported returns the string as a MixedCase string that can be used for exported identifiers.

func LowerFirstRune

func LowerFirstRune(s string) string

LowerFirstRune returns a copy of the string s with the first Unicode letter mapped to its lowercase.

func LowerInitialism

func LowerInitialism(s string) string

LowerInitialism returns the string as all lower case if it matches a supported initialism, otherwise the original value is returned.

func NumToAlpha

func NumToAlpha(s string) string

NumToAlpha checks to see if the first char is a number, if it is, it gets converted to its word equivalent. The rest of the string is uppercased if it is an initialism and title cased since it now counts as a seperate word.

func Unexported

func Unexported(s string) string

Unexported returns the string as a mixedCase string that can be used for unexported identifiers.

func UpperInitialism

func UpperInitialism(s string) string

UpperInitialism returns the string as all UPPER case if it matches a supported initialism, otherwise the original value is returned.

Types

This section is empty.

Jump to

Keyboard shortcuts

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