我无法让parser.ParseDir返回返回的struct.Imports字段中的任何信息。parser.ParseFile似乎确实有效。我宁愿使用ParseDir而不是必须遍历每个文件并调用ParseFile。这是我尝试过的:packagecrawlersimport("fmt""go/parser""go/token""os""path/filepath")typeGoImportsstruct{//imports[]*string}//returnsfullpathsfunc(g*GoImports)Crawl(entrystring)([]*string,error){fp,