]> Cypherpunks repositories - gostls13.git/commitdiff
path: add example for Match
authorJeff Dupont <jeff.dupont@gmail.com>
Thu, 27 Jul 2017 03:27:53 +0000 (20:27 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 13 Feb 2018 18:45:33 +0000 (18:45 +0000)
Change-Id: I5ab475011e9200c5055809e658d14c04c0a07a8a
Reviewed-on: https://go-review.googlesource.com/51413
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/path/example_test.go

index d962e3d3319f1bc34028d57fa9e06d8aa25dc5b7..315401957a797704ced4279dcf74730a0a3ab42c 100644 (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"))