Skip to content
This repository has been archived by the owner on Feb 3, 2018. It is now read-only.

Commit

Permalink
Parameterize import mode by go version
Browse files Browse the repository at this point in the history
  • Loading branch information
sdboyer committed Jun 21, 2016
1 parent 8b7e0d3 commit 20479ac
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
13 changes: 13 additions & 0 deletions import_mode_go15.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// +build !go1.6

package vsolver

import "go/build"

// analysisImportMode returns the import mode used for build.Import() calls for
// standard package analysis.
//
// build.NoVendor was added in go1.6, so we have to omit it here.
func analysisImportMode() build.ImportMode {
return build.ImportComment
}
11 changes: 11 additions & 0 deletions import_mode_go16.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// +build go1.6

package vsolver

import "go/build"

// analysisImportMode returns the import mode used for build.Import() calls for
// standard package analysis.
func analysisImportMode() build.ImportMode {
return build.ImportComment | build.IgnoreVendor
}

0 comments on commit 20479ac

Please sign in to comment.