@@ -675,20 +675,6 @@ func DirImportPath(ctx context.Context, dir string) string {
675675 return "."
676676}
677677
678- // TargetPackages returns the list of packages in the target (top-level) module
679- // matching pattern, which may be relative to the working directory, under all
680- // build tag settings.
681- func TargetPackages (ctx context.Context , pattern string ) * search.Match {
682- // TargetPackages is relative to the main module, so ensure that the main
683- // module is a thing that can contain packages.
684- LoadModFile (ctx ) // Sets Target.
685- ModRoot () // Emits an error if Target cannot contain packages.
686-
687- m := search .NewMatch (pattern )
688- matchPackages (ctx , m , imports .AnyTags (), omitStd , []module.Version {Target })
689- return m
690- }
691-
692678// ImportMap returns the actual package import path
693679// for an import path found in source code.
694680// If the given import path does not appear in the source code
@@ -720,29 +706,6 @@ func PackageModule(path string) module.Version {
720706 return pkg .mod
721707}
722708
723- // PackageImports returns the imports for the package named by the import path.
724- // Test imports will be returned as well if tests were loaded for the package
725- // (i.e., if "all" was loaded or if LoadTests was set and the path was matched
726- // by a command line argument). PackageImports will return nil for
727- // unknown package paths.
728- func PackageImports (path string ) (imports , testImports []string ) {
729- pkg , ok := loaded .pkgCache .Get (path ).(* loadPkg )
730- if ! ok {
731- return nil , nil
732- }
733- imports = make ([]string , len (pkg .imports ))
734- for i , p := range pkg .imports {
735- imports [i ] = p .path
736- }
737- if pkg .test != nil {
738- testImports = make ([]string , len (pkg .test .imports ))
739- for i , p := range pkg .test .imports {
740- testImports [i ] = p .path
741- }
742- }
743- return imports , testImports
744- }
745-
746709// Lookup returns the source directory, import path, and any loading error for
747710// the package at path as imported from the package in parentDir.
748711// Lookup requires that one of the Load functions in this package has already
0 commit comments