Golang go/build.Context.MatchFile() function example
package go/build
MatchFile reports whether the file with the given name in the given directory matches the context and would be included in a Package created by ImportDir of that directory.
MatchFile considers the name of the file and may use ctxt.OpenFile to read some or all of the file's content.
Golang go/build.Context.MatchFile() function usage example
var ctxt Context
var somename string
...
match, err := ctxt.MatchFile("x", somename)
if err != nil {
fmt.Println(err)
}
Reference :
Advertisement
Something interesting
Tutorials
+7.4k Golang : How to detect if a sentence ends with a punctuation?
+8.5k Android Studio : Import third-party library or package into Gradle Scripts
+25.8k Golang : Daemonizing a simple web server process example
+4.6k Javascript : Detect when console is activated and do something about it
+14.5k Golang : How to check if your program is running in a terminal
+29.5k Golang : How to create new XML file ?
+30.4k Golang : Generate random string
+5.6k Fix fatal error: evacuation not done in time problem
+14k Golang : convert rune to unicode hexadecimal value and back to rune character
+13.9k Golang : Get current time
+8.5k Golang : How to check variable or object type during runtime?