Esempio n. 1
0
func TestParseCurrentProject(ot *testing.T) {
	gopath := kmgConfig.DefaultEnv().GOPATHToString()
	goSourcePath := filepath.Join(gopath, "src")
	dirList := kmgFile.MustGetAllDir(goSourcePath)
	for _, dir := range dirList {
		if strings.Contains(dir, "go/loader/testdata") {
			continue
		}
		dir, err := filepath.Rel(goSourcePath, dir)
		if err != nil {
			panic(err)
		}
		MustParsePackage(gopath, dir)
	}
}
Esempio n. 2
0
func TestParseGoSrc(ot *testing.T) {
	gopath := "/usr/local/go"
	goSourcePath := filepath.Join(gopath, "src")
	dirList := kmgFile.MustGetAllDir(goSourcePath)
	for _, dir := range dirList {
		if strings.Contains(dir, "cmd/go/testdata") {
			continue
		}
		dir, err := filepath.Rel(goSourcePath, dir)
		if err != nil {
			panic(err)
		}
		MustParsePackage(gopath, dir)
	}
}