github.com/cockroachdb/cockroach@v20.2.0-alpha.1+incompatible/pkg/cmd/roachtest/go_helpers.go (about) 1 // Copyright 2019 The Cockroach Authors. 2 // 3 // Use of this software is governed by the Business Source License 4 // included in the file licenses/BSL.txt. 5 // 6 // As of the Change Date specified in that file, in accordance with 7 // the Business Source License, use of this software will be governed 8 // by the Apache License, Version 2.0, included in the file 9 // licenses/APL.txt. 10 11 package main 12 13 import "context" 14 15 const goPath = `/mnt/data1/go` 16 17 // installLatestGolang installs the latest version of Go on all nodes in 18 // "node". 19 func installLatestGolang(ctx context.Context, t *test, c *cluster, node nodeListOption) { 20 if err := repeatRunE( 21 ctx, c, node, "add recent go version repository", "sudo add-apt-repository -y ppa:longsleep/golang-backports", 22 ); err != nil { 23 t.Fatal(err) 24 } 25 if err := repeatRunE( 26 ctx, c, node, "update apt-get", `sudo apt-get -qq update`, 27 ); err != nil { 28 t.Fatal(err) 29 } 30 31 if err := repeatRunE( 32 ctx, c, node, "install go", "sudo apt-get install -y golang-go", 33 ); err != nil { 34 t.Fatal(err) 35 } 36 }