casing

package
v2.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: BSD-3-Clause, BSD-3-Clause Imports: 2 Imported by: 0

README

Case conversion

This package contains two functions:

  • Camel copied from the github.com/golang/protobuf/protoc-gen-go/generator package.
  • JSONCamelCase copied from the github.com/protocolbuffers/protobuf-go/internal/strs package.

Both these modules are licensed by The Go Authors, as reflected in this package's [LICENSE.md].

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Camel

func Camel(s string) string

Camel returns the CamelCased name.

This was moved from the now deprecated github.com/golang/protobuf/protoc-gen-go/generator package

If there is an interior underscore followed by a lower case letter, drop the underscore and convert the letter to upper case. There is a remote possibility of this rewrite causing a name collision, but it's so remote we're prepared to pretend it's nonexistent - since the C++ generator lowercases names, it's extremely unlikely to have two fields with different capitalizations. In short, _my_field_name_2 becomes XMyFieldName_2.

func CamelIdentifier added in v2.11.3

func CamelIdentifier(s string) string

CamelIdentifier returns the CamelCased identifier without affecting the package name/path if any.

func JSONCamelCase added in v2.10.1

func JSONCamelCase(s string) string

JSONCamelCase converts a snake_case identifier to a camelCase identifier, according to the protobuf JSON specification.

Types

This section is empty.

Jump to

Keyboard shortcuts

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