spf13/cobraを使った後、goxでビルドしたときに、windows用のバイナリができなかった時の対処方法

spf13/cobraを使い始めてからwindowsのバイナリがない。。。

spf13/cobraを使い始めたら、windows用のバイナリが作成されなかった werckerで、でていたエラーは次のようになっていた。

2 errors occurred:
--> windows/amd64 error: exit status 1
Stderr: ../../fsouza/go-dockerclient/client_windows.go:16:2: cannot find package "github.com/Microsoft/go-winio" in any of:
	/goroot/src/github.com/Microsoft/go-winio (from $GOROOT)
	/gopath/src/github.com/Microsoft/go-winio (from $GOPATH)
../../spf13/cobra/command_win.go:9:2: cannot find package "github.com/inconshreveable/mousetrap" in any of:
	/goroot/src/github.com/inconshreveable/mousetrap (from $GOROOT)
	/gopath/src/github.com/inconshreveable/mousetrap (from $GOPATH)

--> windows/386 error: exit status 1
Stderr: ../../fsouza/go-dockerclient/client_windows.go:16:2: cannot find package "github.com/Microsoft/go-winio" in any of:
	/goroot/src/github.com/Microsoft/go-winio (from $GOROOT)
	/gopath/src/github.com/Microsoft/go-winio (from $GOPATH)
../../spf13/cobra/command_win.go:9:2: cannot find package "github.com/inconshreveable/mousetrap" in any of:
	/goroot/src/github.com/inconshreveable/mousetrap (from $GOROOT)
	/gopath/src/github.com/inconshreveable/mousetrap (from $GOPATH)

spf13/cobra/command_win.go:9:2 を検索したら

このページがひっかかってきた。

最終的にwercker.ymlに以下を追加して解決

  go get github.com/inconshreveable/mousetrap

手元ではそれでよかったがwercker/goxでは、さらに次のものが必要だったようだ。 エラーにも確かに出ている

  go get -d github.com/Microsoft/go-winio

どうも、go-winioの問題らしい。

上のものへのリンクは以下で発見

参考図書

Written on September 24, 2016