From cdb9beffeeaa4ed0defb190551d117de9349f5a9 Mon Sep 17 00:00:00 2001 From: Vojtech Vitek Date: Sun, 18 Dec 2022 17:13:31 +0100 Subject: [PATCH] Add test examples for godoc --- examples_test.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 examples_test.go diff --git a/examples_test.go b/examples_test.go new file mode 100644 index 0000000..f86089c --- /dev/null +++ b/examples_test.go @@ -0,0 +1,27 @@ +package textcase_test + +import ( + "fmt" + + "github.com/golang-cz/textcase" +) + +func ExampleCamelCase() { + fmt.Println(textcase.CamelCase("Hello World!")) + // Output: helloWorld +} + +func ExamplePascalCase() { + fmt.Println(textcase.PascalCase("Hello World!")) + // Output: HelloWorld +} + +func ExampleSnakeCase() { + fmt.Println(textcase.SnakeCase("Hello World!")) + // Output: hello_world +} + +func ExampleKebabCase() { + fmt.Println(textcase.KebabCase("Hello World!")) + // Output: hello-world +}