aboutsummaryrefslogtreecommitdiff
path: root/src/path/example_test.go
diff options
context:
space:
mode:
authorJeff Dupont <jeff.dupont@gmail.com>2017-07-26 20:27:53 -0700
committerBrad Fitzpatrick <bradfitz@golang.org>2018-02-13 18:45:33 +0000
commitd691a31ec1f8cd7a38a781714a82d55dcaf8eb6c (patch)
tree3ac6efb959d27b7b9d96350552763e6a43cf764b /src/path/example_test.go
parentebd04885c8684f170cc86ad42d4d7cb05a28c63b (diff)
downloadgo-d691a31ec1f8cd7a38a781714a82d55dcaf8eb6c.tar.xz
path: add example for Match
Change-Id: I5ab475011e9200c5055809e658d14c04c0a07a8a Reviewed-on: https://go-review.googlesource.com/51413 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/path/example_test.go')
-rw-r--r--src/path/example_test.go10
1 files changed, 10 insertions, 0 deletions
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 <nil>
+ // true <nil>
+ // false <nil>
+}
+
func ExampleSplit() {
fmt.Println(path.Split("static/myfile.css"))
fmt.Println(path.Split("myfile.css"))