Golang functions for converting an English string to/from its possessive form.
package main
import (
ps "github.com/keighl/possessed"
"fmt"
)
func main() {
fmt.Println(ps.Possess("Dave"))
// => Dave's
fmt.Println(ps.Possess("Gladys"))
// => Gladys'
fmt.Println(ps.Possess("it"))
// => its
fmt.Println(ps.Unpossess("Dave's"))
// => Dave
fmt.Println(ps.Unpossess("Gladys'"))
// => Gladys
fmt.Println(ps.Unpossess("its"))
// => it
// Change the apostrophe character
ps.ApostropheChar = `’`
fmt.Println(ps.Possess("Dave"))
// => Dave’s
}