thrift/thrift-gen/gopath.go
func ResolveWithGoPath(filename string) (string, error) {
	for _, file := range goPathCandidates(filename) {
		if _, err := os.Stat(file); !os.IsNotExist(err) {
			return file, nil
		}
	}

	return "", fmt.Errorf("file not found on GOPATH: %q", filename)
}
func ResolveWithGoPath(filename string) (string, error) {
	for _, file := range goPathCandidates(filename) {
		if _, err := os.Stat(file); !os.IsNotExist(err) {
			return file, nil
		}
	}

	return "", fmt.Errorf("file not found on GOPATH: %q", filename)
}
// ResolveWithGoPath will resolve the filename relative to GOPATH and returns
// the first file that exists, or an error otherwise.