Skip to content

Commit

Permalink
Add test examples for godoc
Browse files Browse the repository at this point in the history
  • Loading branch information
VojtechVitek committed Dec 18, 2022
1 parent b9525a3 commit cdb9bef
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions examples_test.go
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit cdb9bef

Please sign in to comment.