import json


def get_packages(platform):
    """
    Resolve and get the list of packages to install for the given platform.

    :param platform: The platform for which the packages needs to be resolved.
    :return: A list of resolved packages to install.
    """
    with open('pkg-resolver/packages.json', encoding='utf-8', mode='r') as pkg_file:
        pkgs = json.loads(pkg_file.read())
    packages = []
    for platforms in filter(lambda x: x.get(platform) is not None, pkgs.values()):
        if isinstance(platforms.get(platform), list):
            packages.extend(platforms.get(platform))
        else:
            packages.append(platforms.get(platform))
    return packages