mattn / gom

Go Manager - bundle for go
1.38k stars 92 forks source link

Adds support of Go 1.6+ and 1.7+. #74

Closed laysakura closed 8 years ago

laysakura commented 8 years ago

@mattn Go 1.6 supports vendoring by default, so GO15VENDOREXPERIMENT env should not be required to use vendor/ directory.

Previously, gom uses _vendor/ directory even with Go version is 1.6+. See: http://akirachiku.com/2016/03/01/go16-development.html#vendoring (Japanese)

gom should use vendor/ directory with Go 1.6+ by default. But when GO15VENDOREXPERIMENT=0 is explicitly set with Go <= 1.6 && >1.7 , gom should use _vendor/ (or GOM_VENDOR_NAME when it's set) because vendoring is not supported by Go itself.

Quote from https://golang.org/doc/go1.6#go_command :

Go 1.5 introduced experimental support for vendoring, enabled by setting the GO15VENDOREXPERIMENT environment variable to 1. Go 1.6 keeps the vendoring support, no longer considered experimental, and enables it by default. It can be disabled explicitly by setting the GO15VENDOREXPERIMENT environment variable to 0. Go 1.7 will remove support for the environment variable.

laysakura commented 8 years ago

I'm trying to find a solution to the test failure... (correct way to get Go version in runtime)

mattn commented 8 years ago

@laysakura これを使って貰っていいでしょうか? https://github.com/mattn/gover

laysakura commented 8 years ago

早すぎる...w 了解です! 少々お待ちください。

mattn commented 8 years ago

go1.4.0 でなく go1.4 を返しますが、問題ないでしょうか?無ければマージします。

laysakura commented 8 years ago

@mattn

go1.4.0 でなく go1.4 を返しますが、問題ないでしょうか?

問題ないです。下記確認しています。

    ver14, _ := version.NewVersion("1.4")
    ver140, _ := version.NewVersion("1.4.0")
    ver150, _ := version.NewVersion("1.5.0")

    fmt.Println(ver140.Equal(ver14))  // => true
    fmt.Println(ver150.GreaterThan(ver14))  // => true
mattn commented 8 years ago

Thank you