私のプロジェクトでは、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
ディレクトリ全体を削除して再構築しようとしました。
v1.1.4(最新のタグ)は昨年9月からのものです。 PanicsWithValueが6月1日に追加されました。 – Adrian
'$ GOPATH/src'にあるバージョンを' dep'に使用させる方法はありますか? – Ralph
私は 'dep'にひどく慣れていませんが、それはすべてかどうかのように見えます。 ( 'version =" * "')でも制約を完全に削除することができ、master @ HEADを使用する必要があります。 – Adrian