2017-08-23 6 views
2

私のプロジェクトでは、Go 1.8を使用してgithub.com/stretchr/testifyに依存しています。 go get -u github.com/stretchr/testifyを使用して最新のものを取得しました。$GOPATH/srcのバージョンが正しいようです。

私はGopkg.tomlにcontraint、最新のバージョン番号を追加しました:

[[constraint]] 
    name = "github.com/stretchr/testify" 
    version = "1.1.4" 

を私はその後、vendorディレクトリ(dep statusの出力)を更新するdep ensure -updateを走った後、dep status

github.com/stretchr/testify ^1.1.4 v1.1.4 69483b4 69483b4 1 

バージョン$GOPATH/srcには、ファイルgithub.com/stretchr/testify/assert/assertions.goには、関数PanicsWithValue

func Panics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { 
    // ... 
} 

func PanicsWithValue(t TestingT, expected interface{}, f PanicTestFunc, msgAndArgs ...interface{}) bool { 
    // ... 
} 

func NotPanics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { 
    // ... 
} 

が、vendorでバージョンで 、その機能が欠落しています。私は間違って何をやっている

func Panics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { 
    // ... 
} 

func NotPanics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool { 
    // ... 
} 

?私のテストではPanicsWithValueという機能を使用したいと思います。私はさらにvendorディレクトリ全体を削除して再構築しようとしました。

+0

v1.1.4(最新のタグ)は昨年9月からのものです。 PanicsWithValueが6月1日に追加されました。 – Adrian

+0

'$ GOPATH/src'にあるバージョンを' dep'に使用させる方法はありますか? – Ralph

+0

私は 'dep'にひどく慣れていませんが、それはすべてかどうかのように見えます。 ( 'version =" * "')でも制約を完全に削除することができ、master @ HEADを使用する必要があります。 – Adrian

答えて

0

バージョンをv1.1.4に固定すると、具体的には、depにあなたが望む機能が含まれていないバージョンを使用するよう指示されます(GitHub-v1.1.4の証言パッケージの履歴は、今年6月にはPanicsWithValueが追加されました)。バージョン(version = "*")の固定を解除する場合は、PanicsWithValueを含むmaster @ HEADを使用する必要があります。

+0

'vendor'のバージョンは、' dep ensure -update;の後に 'PanicsWithValue'関数を含んでいません。 dep prune; depステータス。 – Ralph

+0

'Gopkg.toml'ファイルを更新した後で' dep sure'を実行しましたか? – Adrian

+0

はい。更新されたコメントをご覧ください。 – Ralph

関連する問題