ripple-api/vendor/github.com/serenize/snaker
Morgan Bazalgette 3961e310b1 vendor!
2017-01-14 18:42:10 +01:00
..
LICENSE.txt vendor! 2017-01-14 18:42:10 +01:00
README.md vendor! 2017-01-14 18:42:10 +01:00
snaker.go vendor! 2017-01-14 18:42:10 +01:00

snaker

Build Status GoDoc

This is a small utility to convert camel cased strings to snake case and back, except some defined words.

QBS Usage

To replace the original toSnake and back algorithms for https://github.com/coocood/qbs you can easily use snaker:

Import snaker

import (
  github.com/coocood/qbs
  github.com/serenize/snaker
)

Register the snaker methods to qbs

qbs.ColumnNameToFieldName = snaker.SnakeToCamel
qbs.FieldNameToColumnName = snaker.CamelToSnake