Golang path/filepath.Match() function example
package path/filepath
Golang path/filepath.Match() function usage example
package main
import (
"fmt"
"path/filepath"
)
func main() {
pattern := "a*"
ok, err := filepath.Match(pattern, "apple.mp4")
if err != nil {
panic(err)
}
if ok {
fmt.Println("File name matched!")
} else {
fmt.Println("File name mis-matched!")
}
}
References :
Advertisement
Something interesting
Tutorials
+18.8k Golang : Delete duplicate items from a slice/array
+19.9k Golang : Measure http.Get() execution time
+10.1k Golang : How to tokenize source code with text/scanner package?
+9.1k Golang : io.Reader causing panic: runtime error: invalid memory address or nil pointer dereference
+5.6k Swift : Get substring with rangeOfString() function example
+9.6k Javascript : Read/parse JSON data from HTTP response
+22.5k Golang : Convert Unix timestamp to UTC timestamp
+18.8k Golang : How to make function callback or pass value from function as parameter?
+6.9k Golang : Normalize email to prevent multiple signups example
+6.1k Golang : Build new URL for named or registered route with Gorilla webtoolkit example
+5.5k Clean up Visual Studio For Mac installation failed disk full problem