Skip to content

Commit

Permalink
go: don't set GOTOOLCHAIN=local
Browse files Browse the repository at this point in the history
  • Loading branch information
alebcay authored Jan 15, 2025
1 parent a6ecd82 commit 077ff3e
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions Formula/g/go.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Go < Formula
mirror "https://fossies.org/linux/misc/go1.23.4.src.tar.gz"
sha256 "ad345ac421e90814293a9699cca19dd5238251c3f687980bbcae28495b263531"
license "BSD-3-Clause"
revision 1
head "https://go.googlesource.com/go.git", branch: "master"

livecheck do
Expand Down Expand Up @@ -64,12 +65,6 @@ class Go < Formula
end

def install
inreplace "go.env" do |s|
# Remove misleading comment about automatically downloading newer toolchains.
s.gsub!(/^# Automatically download.*$/, "")
s.gsub!(/^GOTOOLCHAIN=.*$/, "GOTOOLCHAIN=local")
end

(buildpath/"gobootstrap").install resource("gobootstrap")
ENV["GOROOT_BOOTSTRAP"] = buildpath/"gobootstrap"

Expand All @@ -92,17 +87,7 @@ def install
rm_r(libexec/"src/runtime/pprof/testdata")
end

def caveats
<<~EOS
Homebrew's Go toolchain is configured with
GOTOOLCHAIN=local
per Homebrew policy on tools that update themselves.
EOS
end

test do
assert_equal "local", shell_output("#{bin}/go env GOTOOLCHAIN").strip

(testpath/"hello.go").write <<~GO
package main
Expand Down

0 comments on commit 077ff3e

Please sign in to comment.