Extracts a list of imported packages from either a go file or a go package