func fetchImportsDetails(ctx context.Context, ds internal.DataSource, pkgPath, modulePath, resolvedVersion string) (*ImportsDetails, error) {
	dsImports, err := ds.GetImports(ctx, pkgPath, modulePath, resolvedVersion)
	if err != nil {
		return nil, err
	}

	var externalImports, moduleImports, std []string
	for _, p := range dsImports {
		if stdlib.Contains(p) {
			std = append(std, p)
		} else if strings.HasPrefix(p+"/", modulePath+"/") {
			moduleImports = append(moduleImports, p)
		} else {
			externalImports = append(externalImports, p)
		}
	}

	return &ImportsDetails{
		ModulePath:      modulePath,
		ExternalImports: externalImports,
		InternalImports: moduleImports,
		StdLib:          std,
	}, nil
}
// fetchImportsDetails fetches imports for the package version specified by
// pkgPath, modulePath and version from the database and returns a ImportsDetails.
fetchImportsDetails fetches imports for the package version specified by
pkgPath, modulePath and version from the database and returns a ImportsDetails.
// fetchImportsDetails fetches imports for the package version specified by // pkgPath modulePath and version from the database and returns a ImportsDetails .
func fetchImportsDetails(ctx context.Context, ds internal.DataSource, pkgPath, modulePath, resolvedVersion string) (*ImportsDetails, error) {
	dsImports, err := ds.GetImports(ctx, pkgPath, modulePath, resolvedVersion)
	if err != nil {
		return nil, err
	}
	var externalImports, moduleImports, std []string
	for _, p := range dsImports {
		if stdlib.Contains(p) {
			std = append(std, p)
		} else if strings.HasPrefix(p+"/", modulePath+"/") {
			moduleImports = append(moduleImports, p)
		} else {
			externalImports = append(externalImports, p)
		}
	}
	return &ImportsDetails{
		ModulePath:      modulePath,
		ExternalImports: externalImports,
		InternalImports: moduleImports,
		StdLib:          std,
	}, nil
}
func fetchImportsDetails ( ctx context . Context , ds internal . DataSource , pkgPath , modulePath , resolvedVersion string ) ( * ImportsDetails , error ) { dsImports , err := ds . GetImports ( ctx , pkgPath , modulePath , resolvedVersion ) if err != nil { return nil , err } var externalImports , moduleImports , std [ ] string for _ , p := range dsImports { if stdlib . Contains ( p ) { std = append ( std , p ) } else if strings . HasPrefix ( p + " " , modulePath + " " ) { moduleImports = append ( moduleImports , p ) } else { externalImports = append ( externalImports , p ) } } return & ImportsDetails { ModulePath : modulePath , ExternalImports : externalImports , InternalImports : moduleImports , StdLib : std , } , nil }
fetchImportsDetails fetches imports for the package version specified by
pkgPath, modulePath and version from the database and returns a ImportsDetails.
fetchImportsDetails fetches imports for the package version specified by pkgPath modulePath and version from the database and returns a ImportsDetails .