21 lines
522 B
Go
21 lines
522 B
Go
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
|
|
}
|