From: Jeff Dupont Date: Thu, 27 Jul 2017 03:27:53 +0000 (-0700) Subject: path: add example for Match X-Git-Tag: go1.11beta1~1690 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d691a31ec1f8cd7a38a781714a82d55dcaf8eb6c;p=gostls13.git path: add example for Match Change-Id: I5ab475011e9200c5055809e658d14c04c0a07a8a Reviewed-on: https://go-review.googlesource.com/51413 Reviewed-by: Brad Fitzpatrick --- diff --git a/src/path/example_test.go b/src/path/example_test.go index d962e3d331..315401957a 100644 --- a/src/path/example_test.go +++ b/src/path/example_test.go @@ -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 + // true + // false +} + func ExampleSplit() { fmt.Println(path.Split("static/myfile.css")) fmt.Println(path.Split("myfile.css"))