def _symlink_remote_lib(self, gopath, go_remote_lib, required_links):
    """Creates symlinks from the given gopath to the source files of the given remote lib.

    Also duplicates directory structure leading to source files of package within
    gopath, in order to provide isolation to the package.

    Adds the symlinks to the source files to required_links.
    """
    def source_iter():
      remote_lib_source_dir = self.context.products.get_data('go_remote_lib_src')[go_remote_lib]
      for path in os.listdir(remote_lib_source_dir):
        remote_src = os.path.join(remote_lib_source_dir, path)
        # We grab any file since a go package might have .go, .c, .cc, etc files - all needed for
        # installation.
        if os.path.isfile(remote_src):
          yield (remote_src, os.path.basename(path))
    return self._symlink_lib(gopath, go_remote_lib, source_iter(), required_links)
Creates symlinks from the given gopath to the source files of the given remote lib.

    Also duplicates directory structure leading to source files of package within
    gopath, in order to provide isolation to the package.

    Adds the symlinks to the source files to required_links.