Skip to content
Draft
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
File renamed without changes.
16 changes: 8 additions & 8 deletions Formula/g/go.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class Go < Formula
desc "Open source programming language to build simple/reliable/efficient software"
homepage "https://go.dev/"
url "https://go.dev/dl/go1.25.6.src.tar.gz"
mirror "https://fossies.org/linux/misc/go1.25.6.src.tar.gz"
sha256 "58cbf771e44d76de6f56d19e33b77d745a1e489340922875e46585b975c2b059"
url "https://go.dev/dl/go1.26rc2.src.tar.gz"
mirror "https://fossies.org/linux/misc/go1.26rc2.src.tar.gz"
sha256 "e25cc8c5ffe1241a5d87199209243d70c24847260fb1ea7b163a95b537de65ac"
license "BSD-3-Clause"
head "https://go.googlesource.com/go.git", branch: "master"

Expand Down Expand Up @@ -34,13 +34,13 @@
# Don't update this unless this version cannot bootstrap the new version.
resource "gobootstrap" do
checksums = {
"darwin-arm64" => "416c35218edb9d20990b5d8fc87be655d8b39926f15524ea35c66ee70273050d",
"darwin-amd64" => "e7bbe07e96f0bd3df04225090fe1e7852ed33af37c43a23e16edbbb3b90a5b7c",
"linux-arm64" => "fd017e647ec28525e86ae8203236e0653242722a7436929b1f775744e26278e7",
"linux-amd64" => "4fa4f869b0f7fc6bb1eb2660e74657fbf04cdd290b5aef905585c86051b34d43",
"darwin-arm64" => "098d0c039357c3652ec6c97d5451bc4dc24f7cf30ed902373ed9a8134aab2d29",
"darwin-amd64" => "4b9cc6771b56645da35a83a5424ae507f3250829b0d227e75f57b73e72da1f76",
"linux-arm64" => "4e02e2979e53b40f3666bba9f7e5ea0b99ea5156e0824b343fd054742c25498d",
"linux-amd64" => "bddf8e653c82429aea7aec2520774e79925d4bb929fe20e67ecc00dd5af44c50",
}

version "1.22.12"
version "1.24.12"

on_arm do
on_macos do
Expand Down
86 changes: 86 additions & 0 deletions Formula/g/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
class GoAT125 < Formula
desc "Open source programming language to build simple/reliable/efficient software"
homepage "https://go.dev/"
url "https://go.dev/dl/go1.25.6.src.tar.gz"
mirror "https://fossies.org/linux/misc/go1.25.6.src.tar.gz"
sha256 "58cbf771e44d76de6f56d19e33b77d745a1e489340922875e46585b975c2b059"
license "BSD-3-Clause"

livecheck do
url "https://go.dev/dl/?mode=json"
regex(/^go[._-]?v?(1\.25(?:\.\d+)*)[._-]src\.t.+$/i)
strategy :json do |json, regex|
json.map do |release|
next if release["stable"] != true
next if release["files"].none? { |file| file["filename"].match?(regex) }

release["version"][/(\d+(?:\.\d+)+)/, 1]
end
end
end

keg_only :versioned_formula

depends_on "go" => :build

def install
libexec.install Dir["*"]

cd libexec/"src" do
# Set portable defaults for CC/CXX to be used by cgo
with_env(CC: "cc", CXX: "c++") { system "./make.bash" }
end

bin.install_symlink Dir[libexec/"bin/go*"]

# Remove useless files.
# Breaks patchelf because folder contains weird debug/test files
rm_r(libexec/"src/debug/elf/testdata")
# Binaries built for an incompatible architecture
rm_r(libexec/"src/runtime/pprof/testdata")
# Remove testdata with binaries for non-native architectures.
rm_r(libexec/"src/debug/dwarf/testdata")
end

test do
(testpath/"hello.go").write <<~GO
package main

import "fmt"

func main() {
fmt.Println("Hello World")
}
GO

# Run go fmt check for no errors then run the program.
# This is a a bare minimum of go working as it uses fmt, build, and run.
system bin/"go", "fmt", "hello.go"
assert_equal "Hello World\n", shell_output("#{bin}/go run hello.go")

with_env(GOOS: "freebsd", GOARCH: "amd64") do
system bin/"go", "build", "hello.go"
end

(testpath/"hello_cgo.go").write <<~GO
package main

/*
#include <stdlib.h>
#include <stdio.h>
void hello() { printf("%s\\n", "Hello from cgo!"); fflush(stdout); }
*/
import "C"

func main() {
C.hello()
}
GO

# Try running a sample using cgo without CC or CXX set to ensure that the
# toolchain's default choice of compilers work
with_env(CC: nil, CXX: nil, CGO_ENABLED: "1") do
assert_equal "Hello from cgo!\n", shell_output("#{bin}/go run hello_cgo.go")
end
end
end
1 change: 1 addition & 0 deletions Formula/g/golangci-lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class GolangciLint < Formula
tag: "v2.8.0",
revision: "e2e40021c9007020676c93680a36e3ab06c6cd33"
license "GPL-3.0-only"
revision 1
head "https://github.com/golangci/golangci-lint.git", branch: "main"

bottle do
Expand Down
1 change: 1 addition & 0 deletions audit_exceptions/unstable_allowlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"automysqlbackup": "3.0-rc",
"aview": "1.3.0rc",
"ftgl": "2.1.3-rc",
"go": "1.26rc",
"libcaca": "0.99b",
"librasterlite2": "1.1.0-beta",
"premake": "5.0.0-beta",
Expand Down
Loading