mirror of
https://github.com/golang/go
synced 2024-11-19 21:24:40 -07:00
path: add example for Match
Change-Id: I5ab475011e9200c5055809e658d14c04c0a07a8a Reviewed-on: https://go-review.googlesource.com/51413 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
ebd04885c8
commit
d691a31ec1
@ -91,6 +91,16 @@ func ExampleJoin() {
|
||||
// a
|
||||
}
|
||||
|
||||
func ExampleMatch() {
|
||||
fmt.Println(path.Match("abc", "abc"))
|
||||
fmt.Println(path.Match("a*", "abc"))
|
||||
fmt.Println(path.Match("a*/b", "a/c/b"))
|
||||
// Output:
|
||||
// true <nil>
|
||||
// true <nil>
|
||||
// false <nil>
|
||||
}
|
||||
|
||||
func ExampleSplit() {
|
||||
fmt.Println(path.Split("static/myfile.css"))
|
||||
fmt.Println(path.Split("myfile.css"))
|
||||
|
Loading…
Reference in New Issue
Block a user