github.com/rogpeppe/juju@v0.0.0-20140613142852-6337964b789e/testing/imports.go (about)

     1  // Copyright 2013 Canonical Ltd.
     2  // Licensed under the AGPLv3, see LICENCE file for details.
     3  
     4  package testing
     5  
     6  import (
     7  	"github.com/juju/testing"
     8  	gc "launchpad.net/gocheck"
     9  )
    10  
    11  const jujuPkgPrefix = "github.com/juju/juju/"
    12  
    13  // FindJujuCoreImports returns a sorted list of juju-core packages that are
    14  // imported by the packageName parameter.  The resulting list removes the
    15  // common prefix "github.com/juju/juju/" leaving just the short names.
    16  func FindJujuCoreImports(c *gc.C, packageName string) []string {
    17  	imps, err := testing.FindImports(packageName, jujuPkgPrefix)
    18  	c.Assert(err, gc.IsNil)
    19  	return imps
    20  }