Skip to content

Import Restrictions

Joe Kralicky edited this page Apr 20, 2023 · 2 revisions

Developer Documentation: Import Restrictions

This document outlines the import restrictions in place for Go code in the main Opni repo. These restrictions help prevent accidentally importing packages in certain locations which can cause binary sizes to increase significantly (especially test binaries) and can slow down build/test times.

These rules are automatically checked for when linting (run mage lint).

Restricted Import List:

  • github.com/rancher/opni/plugins/* except from:

    • github.com/rancher/opni/plugins/*
    • Test packages
    • github.com/rancher/opni/cmd/*
    • github.com/rancher/opni/pkg/opni/*
    • github.com/rancher/opni/internal/cmd/*
  • github.com/rancher/opni/pkg/test/* except from:

    • Test packages
    • github.com/rancher/opni/test/*
    • github.com/rancher/opni/plugins/*/test
    • github.com/rancher/opni/internal/mage/*
    • github.com/rancher/opni/internal/cmd/testenv
  • github.com/rancher/opni/test (no exceptions)

  • github.com/rancher/opni/web except from:

    • github.com/rancher/opni/pkg/opni/commands
    • github.com/rancher/opni/pkg/dashboard
  • github.com/rancher/opni/pkg/dashboard except from:

    • github.com/rancher/opni/pkg/opni/commands
    • github.com/rancher/opni/internal/cmd/testenv
  • github.com/rancher/opni/controllers except from:

    • github.com/rancher/opni/pkg/opni/commands
  • github.com/rancher/opni/pkg/opni/commands except from:

    • github.com/rancher/opni/pkg/opni
Clone this wiki locally