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 :

http://golang.org/pkg/go/build/#NoGoError

Advertisement