Exemplo n.º 1
0
func test1() {
	Replace := shaper.NewFilter().ApplyReplace("test", "biscuit", -1)
	// Add stages later on
	Replace.ApplyToUpper()

	// Demonstrating copy
	Extra := Replace.Copy()
	// The copy has everything Replace had (note the change to Testificate.)
	Extra.ApplyReplace("THIS", "THAT", -1)
	fmt.Printf("%s\n", Extra.Process("This is also a test. Testificate."))
	fmt.Print("^^^^\n")
	// but Replace still has the old original effect.
	fmt.Printf("%s\n", Replace.Process("This is also a test. Testificate."))
	fmt.Print("^^^^\n")
}
Exemplo n.º 2
0
// Make a new Shaper filter and start adding bits
func NewFilter() *Shaper {
	return &Shaper{Shaper: shaper.NewFilter()}
}