Skip to content
File renamed without changes.
1 change: 1 addition & 0 deletions Formula/e/errcheck.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
class Errcheck < Formula
desc "Finds silently ignored errors in Go code"
homepage "https://github.com/kisielk/errcheck"
url "https://github.com/kisielk/errcheck/archive/refs/tags/v1.9.0.tar.gz"
sha256 "f8b9c864c0bdc8e56fbd709fb97a04b43b989815641b8bd9aae2e5fbc43b6930"
license "MIT"
revision 1

bottle do
sha256 cellar: :any_skip_relocation, arm64_sequoia: "b0c68d0627e96f81d5c9908e475a382997f174292480d7e401b9611684ccdd1f"
Expand Down
6 changes: 3 additions & 3 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.24.6.src.tar.gz"
mirror "https://fossies.org/linux/misc/go1.24.6.src.tar.gz"
sha256 "e1cb5582aab588668bc04c07de18688070f6b8c9b2aaf361f821e19bd47cfdbd"
url "https://go.dev/dl/go1.25.0.src.tar.gz"
mirror "https://fossies.org/linux/misc/go1.25.0.src.tar.gz"
sha256 "4bd01e91297207bfa450ea40d4d5a93b1b531a5e438473b2a06e18e077227225"
license "BSD-3-Clause"
head "https://go.googlesource.com/go.git", branch: "master"

Expand Down
86 changes: 86 additions & 0 deletions Formula/g/go@1.24.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
class GoAT124 < Formula
desc "Open source programming language to build simple/reliable/efficient software"
homepage "https://go.dev/"
url "https://go.dev/dl/go1.24.6.src.tar.gz"
mirror "https://fossies.org/linux/misc/go1.24.6.src.tar.gz"
sha256 "e1cb5582aab588668bc04c07de18688070f6b8c9b2aaf361f821e19bd47cfdbd"
license "BSD-3-Clause"

livecheck do
url "https://go.dev/dl/?mode=json"
regex(/^go[._-]?v?(1\.24(?:\.\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) 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
@@ -1,3 +1,3 @@
class GolangciLint < Formula
desc "Fast linters runner for Go"
homepage "https://golangci-lint.run/"
Expand All @@ -5,6 +5,7 @@
tag: "v2.3.1",
revision: "5256574b81bcedfbcae9099f745f6aee9335da10"
license "GPL-3.0-only"
revision 1
head "https://github.com/golangci/golangci-lint.git", branch: "master"

bottle do
Expand Down
2 changes: 1 addition & 1 deletion Formula/g/govulncheck.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class Govulncheck < Formula
desc "Database client and tools for the Go vulnerability database"
homepage "https://github.com/golang/vuln"
url "https://github.com/golang/vuln/archive/refs/tags/v1.1.4.tar.gz"
sha256 "da1a7f3224cf874325814dd198eaa42897143fc871226a04944583cb121a15c9"
license "BSD-3-Clause"
revision 1
revision 2
head "https://github.com/golang/vuln.git", branch: "master"

bottle do
Expand All @@ -22,7 +22,7 @@
system "go", "build", *std_go_args(ldflags: "-s -w"), "./cmd/govulncheck"
end

test do

Check warning on line 25 in Formula/g/govulncheck.rb

View workflow job for this annotation

GitHub Actions / Linux arm64

`brew test --verbose govulncheck` failed on Linux arm64!

/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/test.rb:54:in '<main>'
mkdir "brewtest" do
system "go", "mod", "init", "brewtest"
(testpath/"brewtest/main.go").write <<~GO
Expand Down
2 changes: 1 addition & 1 deletion Formula/s/staticcheck.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class Staticcheck < Formula
desc "State of the art linter for the Go programming language"
homepage "https://staticcheck.dev/"
url "https://github.com/dominikh/go-tools/archive/refs/tags/2025.1.1.tar.gz"
sha256 "259aaf528e4d98e7d3652e283e8551cfdb98cd033a7c01003cd377c2444dd6de"
license "MIT"
revision 5
revision 6
head "https://github.com/dominikh/go-tools.git", branch: "master"

bottle do
Expand All @@ -22,7 +22,7 @@
system "go", "build", *std_go_args(ldflags: "-s -w"), "./cmd/staticcheck"
end

test do

Check warning on line 25 in Formula/s/staticcheck.rb

View workflow job for this annotation

GitHub Actions / Linux arm64

`brew test --verbose staticcheck` failed on Linux arm64!

/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/test.rb:54:in '<main>'
system "go", "mod", "init", "brewtest"
(testpath/"test.go").write <<~GO
package main
Expand Down
Loading