Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to go 1.5.1 [#104131294] #609

Merged
merged 1 commit into from
Oct 1, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: go
go:
- 1.4.2
- 1.5.1
install:
- go get -v golang.org/x/tools/cmd/vet
- go get -v github.com/tools/godep
Expand Down
1 change: 1 addition & 0 deletions cf/help/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func GetHelpTemplate() string {

{{.Title "` + T("GLOBAL OPTIONS:") + `"}}
--version, -v ` + T("Print the version") + `
--build, -b ` + T("Print the version of Go the CLI was built against") + `
--help, -h ` + T("Show help") + `

`
Expand Down
10 changes: 10 additions & 0 deletions cf/i18n/resources/de_DE.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3604,6 +3604,11 @@
"translation": "Print the version",
"modified": false
},
{
"id": "Print the version of Go the CLI was built against",
"translation": "Print the version of Go the CLI was built against",
"modified": false
},
{
"id": "Problem removing downloaded binary in temp directory: ",
"translation": "Problem removing downloaded binary in temp directory: ",
Expand Down Expand Up @@ -5464,6 +5469,11 @@
"translation": "{{.CFName}} login",
"modified": false
},
{
"id": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"translation": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"modified": false
},
{
"id": "{{.CountOfServices}} migrated.",
"translation": "{{.CountOfServices}} migrated.",
Expand Down
10 changes: 10 additions & 0 deletions cf/i18n/resources/en_US.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3604,6 +3604,11 @@
"translation": "Print the version",
"modified": false
},
{
"id": "Print the version of Go the CLI was built against",
"translation": "Print the version of Go the CLI was built against",
"modified": false
},
{
"id": "Problem removing downloaded binary in temp directory: ",
"translation": "Problem removing downloaded binary in temp directory: ",
Expand Down Expand Up @@ -5464,6 +5469,11 @@
"translation": "{{.CFName}} login",
"modified": false
},
{
"id": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"translation": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"modified": false
},
{
"id": "{{.CountOfServices}} migrated.",
"translation": "{{.CountOfServices}} migrated.",
Expand Down
10 changes: 10 additions & 0 deletions cf/i18n/resources/es_ES.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3604,6 +3604,11 @@
"translation": "Imprime la version",
"modified": false
},
{
"id": "Print the version of Go the CLI was built against",
"translation": "Print the version of Go the CLI was built against",
"modified": false
},
{
"id": "Problem removing downloaded binary in temp directory: ",
"translation": "Problem removing downloaded binary in temp directory: ",
Expand Down Expand Up @@ -5464,6 +5469,11 @@
"translation": "{{.CFName}} login",
"modified": false
},
{
"id": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"translation": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"modified": false
},
{
"id": "{{.CountOfServices}} migrated.",
"translation": "{{.CountOfServices}} migrated.",
Expand Down
10 changes: 10 additions & 0 deletions cf/i18n/resources/fr_FR.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3604,6 +3604,11 @@
"translation": "Affiche la version",
"modified": false
},
{
"id": "Print the version of Go the CLI was built against",
"translation": "Print the version of Go the CLI was built against",
"modified": false
},
{
"id": "Problem removing downloaded binary in temp directory: ",
"translation": "Problem removing downloaded binary in temp directory: ",
Expand Down Expand Up @@ -5464,6 +5469,11 @@
"translation": "{{.CFName}} login",
"modified": false
},
{
"id": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"translation": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"modified": false
},
{
"id": "{{.CountOfServices}} migrated.",
"translation": "{{.CountOfServices}} migré.",
Expand Down
10 changes: 10 additions & 0 deletions cf/i18n/resources/it_IT.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3604,6 +3604,11 @@
"translation": "Print the version",
"modified": false
},
{
"id": "Print the version of Go the CLI was built against",
"translation": "Print the version of Go the CLI was built against",
"modified": false
},
{
"id": "Problem removing downloaded binary in temp directory: ",
"translation": "Problem removing downloaded binary in temp directory: ",
Expand Down Expand Up @@ -5464,6 +5469,11 @@
"translation": "{{.CFName}} login",
"modified": false
},
{
"id": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"translation": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"modified": false
},
{
"id": "{{.CountOfServices}} migrated.",
"translation": "{{.CountOfServices}} migrated.",
Expand Down
10 changes: 10 additions & 0 deletions cf/i18n/resources/ja_JA.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3604,6 +3604,11 @@
"translation": "Print the version",
"modified": false
},
{
"id": "Print the version of Go the CLI was built against",
"translation": "Print the version of Go the CLI was built against",
"modified": false
},
{
"id": "Problem removing downloaded binary in temp directory: ",
"translation": "Problem removing downloaded binary in temp directory: ",
Expand Down Expand Up @@ -5464,6 +5469,11 @@
"translation": "{{.CFName}} login",
"modified": false
},
{
"id": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"translation": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"modified": false
},
{
"id": "{{.CountOfServices}} migrated.",
"translation": "{{.CountOfServices}} migrated.",
Expand Down
10 changes: 10 additions & 0 deletions cf/i18n/resources/pt_BR.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3604,6 +3604,11 @@
"translation": "Exibir versão",
"modified": false
},
{
"id": "Print the version of Go the CLI was built against",
"translation": "Print the version of Go the CLI was built against",
"modified": false
},
{
"id": "Problem removing downloaded binary in temp directory: ",
"translation": "Problem removing downloaded binary in temp directory: ",
Expand Down Expand Up @@ -5464,6 +5469,11 @@
"translation": "{{.CFName}} login",
"modified": false
},
{
"id": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"translation": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"modified": false
},
{
"id": "{{.CountOfServices}} migrated.",
"translation": "{{.CountOfServices}} migrado.",
Expand Down
10 changes: 10 additions & 0 deletions cf/i18n/resources/zh_Hans.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3604,6 +3604,11 @@
"translation": "打印版本号",
"modified": false
},
{
"id": "Print the version of Go the CLI was built against",
"translation": "Print the version of Go the CLI was built against",
"modified": false
},
{
"id": "Problem removing downloaded binary in temp directory: ",
"translation": "Problem removing downloaded binary in temp directory: ",
Expand Down Expand Up @@ -5464,6 +5469,11 @@
"translation": "{{.CFName}} login",
"modified": false
},
{
"id": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"translation": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"modified": false
},
{
"id": "{{.CountOfServices}} migrated.",
"translation": "{{.CountOfServices}} 迁移.",
Expand Down
10 changes: 10 additions & 0 deletions cf/i18n/resources/zh_Hant.all.json
Original file line number Diff line number Diff line change
Expand Up @@ -3604,6 +3604,11 @@
"translation": "Print the version",
"modified": false
},
{
"id": "Print the version of Go the CLI was built against",
"translation": "Print the version of Go the CLI was built against",
"modified": false
},
{
"id": "Problem removing downloaded binary in temp directory: ",
"translation": "Problem removing downloaded binary in temp directory: ",
Expand Down Expand Up @@ -5464,6 +5469,11 @@
"translation": "{{.CFName}} login",
"modified": false
},
{
"id": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"translation": "{{.CFName}} was built with Go version: {{.GoVersion}}",
"modified": false
},
{
"id": "{{.CountOfServices}} migrated.",
"translation": "{{.CountOfServices}} migrated.",
Expand Down
10 changes: 10 additions & 0 deletions main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ func main() {
os.Exit(0)
}

//handle `cf --build`
if len(os.Args) == 2 && (os.Args[1] == "--build" || os.Args[1] == "-b") {
deps.Ui.Say(T("{{.CFName}} was built with Go version: {{.GoVersion}}",
map[string]interface{}{
"CFName": os.Args[0],
"GoVersion": runtime.Version(),
}))
os.Exit(0)
}

//handles `cf [COMMAND] -h ...`
//rearrage args to `cf help COMMAND` and let `command help` to print out usage
if requestHelp(os.Args[2:]) {
Expand Down
22 changes: 22 additions & 0 deletions main/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,28 @@ var _ = Describe("main", func() {
})
})

Describe("Shows debug information with -b or --build", func() {
It("prints the golang version if '--build' flag is provided", func() {
output := Cf("--build").Wait(1 * time.Second)
Eventually(output.Out.Contents).Should(ContainSubstring("was built with Go version:"))
Ω(output.ExitCode()).To(Equal(0))
})

It("prints the golang version if '-b' flag is provided", func() {
output := Cf("-b").Wait(1 * time.Second)
Eventually(output.Out.Contents).Should(ContainSubstring("was built with Go version:"))
Ω(output.ExitCode()).To(Equal(0))
})
})

Describe("Staying abreast of Security Vulerabilities", func() {
It("uses Go 1.5.1 as the most up to date Go compiler", func() {
output := Cf("--build").Wait(1 * time.Second)
Eventually(output.Out.Contents).Should(ContainSubstring("go1.5.1"))
Ω(output.ExitCode()).To(Equal(0))
})
})

Describe("Commands /w new non-codegangsta structure", func() {
It("prints usage help for all non-codegangsta commands by providing `help` flag", func() {
output := Cf("api", "-h").Wait(1 * time.Second)
Expand Down