def flatten_deps(deps):
  """Converts deps.lock dict into a list of go packages specified there."""
  out = []
  for p in deps['imports']:
    # Each 'p' here have a form similar to:
    #
    # - name: golang.org/x/net
    #   version: 31df19d69da8728e9220def59b80ee577c3e48bf
    #   repo: https://go.googlesource.com/net.git
    #   subpackages:
    #   - context
    #   - context/ctxhttp
    #
    # where empty 'subpackages' means an entire repo is used.
    sub = p.get('subpackages')
    if not sub:
      out.append(p['name'])
    else:
      out.extend(p['name'] + '/' + subpkg for subpkg in sub)
  return sorted(out)