@@ -935,11 +935,7 @@ func (s *Session) BuildFiles(filenames []string, pkgObj string, cwd string) erro
935935//
936936// Relative paths are interpreted relative to the current working dir.
937937func (s * Session ) BuildImportPath (path string ) (* compiler.Archive , error ) {
938- _ , parsed , err := s .buildImportPathWithSrcDir (path , "" )
939- if err != nil {
940- return nil , err
941- }
942- return s .CompilePackage (parsed )
938+ return s .ImportResolverFor ("" )(path )
943939}
944940
945941// buildImportPathWithSrcDir builds the package specified by the import path.
@@ -1037,6 +1033,7 @@ func (s *Session) BuildPackage(pkg *PackageData) (*ParsedPackage, error) {
10371033 // Create the parsed package and cache it.
10381034 parsed := & ParsedPackage {
10391035 ImportPath : pkg .ImportPath ,
1036+ Dir : pkg .Dir ,
10401037 Imports : imports ,
10411038 GoFiles : files ,
10421039 FSet : fileSet ,
@@ -1135,16 +1132,7 @@ func (s *Session) WriteCommandPackage(archive *compiler.Archive, pkgObj string)
11351132 sourceMapFilter .MappingCallback = s .SourceMappingCallback (m )
11361133 }
11371134
1138- deps , err := compiler .ImportDependencies (archive , func (path string ) (* compiler.Archive , error ) {
1139- if archive , ok := s .UpToDateArchives [path ]; ok {
1140- return archive , nil
1141- }
1142- _ , parsed , err := s .buildImportPathWithSrcDir (path , "" )
1143- if err != nil {
1144- return nil , err
1145- }
1146- return s .CompilePackage (parsed )
1147- })
1135+ deps , err := compiler .ImportDependencies (archive , s .ImportResolverFor ("" ))
11481136 if err != nil {
11491137 return err
11501138 }
0 commit comments