Skip to content
Closed
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.
1 change: 1 addition & 0 deletions Formula/go-critic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class GoCritic < Formula
url "https://github.com/go-critic/go-critic/archive/refs/tags/v0.6.3.tar.gz"
sha256 "74fd0995f401c49206b569f4c11be867da01f627e8979861d67ac8ea60173d7d"
license "MIT"
revision 1
head "https://github.com/go-critic/go-critic.git", branch: "master"

livecheck do
Expand Down
6 changes: 3 additions & 3 deletions Formula/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.18.5.src.tar.gz"
mirror "https://fossies.org/linux/misc/go1.18.5.src.tar.gz"
sha256 "9920d3306a1ac536cdd2c796d6cb3c54bc559c226fc3cc39c32f1e0bd7f50d2a"
url "https://go.dev/dl/go1.19.src.tar.gz"
mirror "https://fossies.org/linux/misc/go1.19.src.tar.gz"
sha256 "9419cc70dc5a2523f29a77053cafff658ed21ef3561d9b6b020280ebceab28b9"
license "BSD-3-Clause"
head "https://go.googlesource.com/go.git", branch: "master"

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

livecheck do
url "https://go.dev/dl/"
regex(/href=.*?go[._-]?v?(1\.18(?:\.\d+)*)[._-]src\.t/i)
end

keg_only :versioned_formula

# Don't update this unless this version cannot bootstrap the new version.
resource "gobootstrap" do
checksums = {
"darwin-arm64" => "4dac57c00168d30bbd02d95131d5de9ca88e04f2c5a29a404576f30ae9b54810",
"darwin-amd64" => "6000a9522975d116bf76044967d7e69e04e982e9625330d9a539a8b45395f9a8",
"linux-arm64" => "3770f7eb22d05e25fbee8fb53c2a4e897da043eb83c69b9a14f8d98562cd8098",
"linux-amd64" => "013a489ebb3e24ef3d915abe5b94c3286c070dfe0818d5bca8108f1d6e8440d2",
}

arch = "arm64"
platform = "darwin"

on_intel do
arch = "amd64"
end

on_linux do
platform = "linux"
end

boot_version = "1.16"

url "https://storage.googleapis.com/golang/go#{boot_version}.#{platform}-#{arch}.tar.gz"
version boot_version
sha256 checksums["#{platform}-#{arch}"]
end

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

cd "src" do
ENV["GOROOT_FINAL"] = libexec
system "./make.bash", "--no-clean"
end

(buildpath/"pkg/obj").rmtree
rm_rf "gobootstrap" # Bootstrap not required beyond compile.
libexec.install Dir["*"]
bin.install_symlink Dir[libexec/"bin/go*"]

system bin/"go", "install", "-race", "std"

# Remove useless files.
# Breaks patchelf because folder contains weird debug/test files
(libexec/"src/debug/elf/testdata").rmtree
# Binaries built for an incompatible architecture
(libexec/"src/runtime/pprof/testdata").rmtree
end

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

import "fmt"

func main() {
fmt.Println("Hello World")
}
EOS
# 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")

ENV["GOOS"] = "freebsd"
ENV["GOARCH"] = "amd64"
system bin/"go", "build", "hello.go"
end
end
1 change: 1 addition & 0 deletions Formula/golangci-lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class GolangciLint < Formula
tag: "v1.48.0",
revision: "2d8fea819e651d384cf47784a5fb9c789cf5bd59"
license "GPL-3.0-only"
revision 1
head "https://github.com/golangci/golangci-lint.git", branch: "master"

bottle do
Expand Down