Golang go/build.NoGoError type example
package go/build
NoGoError is the error used by Import to describe a directory containing no buildable Go source files. (It may still contain test files, files hidden by build tags, and so on.)
Golang go/build.NoGoError type usage example
var dirname string
ctxt := build.Default
pkginfo, err := ctxt.ImportDir(dirname, 0)
if _, nogo := err.(*build.NoGoError); err != nil && !nogo {
return nil, err
}
Reference :
Advertisement
Something interesting
Tutorials
+22.9k Golang : Test file read write permission example
+8.9k Golang : Find network service name from given port and protocol
+16.5k Golang : Check if a string contains multiple sub-strings in []string?
+52.6k Golang : How to get struct field and value by name
+4.7k Chrome : How to block socketloop.com links in Google SERP?
+14.5k Golang : Rename directory
+6.2k Golang : Calculate US Dollar Index (DXY)
+62.7k Golang : Convert HTTP Response body to string
+20.5k Golang : Pipe output from one os.Exec(shell command) to another command
+16.8k Golang : Read integer from file into array
+19.6k Golang : Get current URL example
+6k Linux/MacOSX : Search for files by filename and extension with find command