Docfix: cleanup
This commit is contained in:
20
protocol/match_example_test.go
Normal file
20
protocol/match_example_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package protocol_test
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"git.maze.io/go/dpi/protocol"
|
||||
)
|
||||
|
||||
func ExampleMatch() {
|
||||
fmt.Println(protocol.Match("t?s?", []byte("test")))
|
||||
fmt.Println(protocol.Match("t?s?", []byte("test with more data")))
|
||||
fmt.Println(protocol.Match("t?s?", []byte("text with more data")))
|
||||
fmt.Println(protocol.Match("select * from user", []byte("select an apple from user")))
|
||||
fmt.Println(protocol.Match("select * from user", []byte("select an apple from the user")))
|
||||
// Output: true
|
||||
// true
|
||||
// false
|
||||
// true
|
||||
// false
|
||||
}
|
Reference in New Issue
Block a user