1
0
mirror of https://github.com/golang/go synced 2024-11-19 21:14:43 -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:
Jeff Dupont 2017-07-26 20:27:53 -07:00 committed by Brad Fitzpatrick
parent ebd04885c8
commit d691a31ec1

View File

@ -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"))