-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
repro for bazel-contrib/rules_go#4084 (comment)
- Loading branch information
0 parents
commit 98e2446
Showing
7 changed files
with
204 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# OSX leaves these everywhere on SMB shares | ||
._* | ||
|
||
# OSX trash | ||
.DS_Store | ||
|
||
# From https://github.com/bazelbuild/bazel/blob/master/.gitignore | ||
|
||
/bazel-* | ||
# Ignore outputs generated during Bazel bootstrapping. | ||
/output/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
load("@rules_go//go:def.bzl", "go_binary", "go_library") | ||
load("@rules_go//go:def.bzl", "TOOLS_NOGO", "nogo") | ||
|
||
nogo( | ||
name = "nogo", | ||
visibility = ["//visibility:public"], | ||
deps = TOOLS_NOGO, | ||
) | ||
|
||
go_library( | ||
name = "rand32_lib", | ||
srcs = ["rand32.go"], | ||
visibility = ["//visibility:private"], | ||
) | ||
|
||
go_binary( | ||
name = "rand32", | ||
embed = [":rand32_lib"], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
bazel_dep(name = "gazelle", version = "0.38.0") | ||
bazel_dep(name = "rules_go", version = "0.50.0") | ||
|
||
#### | ||
# rules_go | ||
#### | ||
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk") | ||
go_sdk.download(version = "1.23.0") | ||
go_sdk.nogo(nogo = "//:nogo") | ||
|
||
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps") | ||
go_deps.from_file(go_mod = "//:go.mod") |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/aran | ||
|
||
go 1.23.0 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package main | ||
|
||
import ( | ||
"crypto/rand" | ||
"encoding/base64" | ||
"fmt" | ||
"os" | ||
) | ||
|
||
func main() { | ||
c := 32 * 6 / 8 | ||
out := os.Stdout | ||
|
||
encoded := base64.NewEncoder(base64.URLEncoding, out) | ||
defer encoded.Close() | ||
b := make([]byte, c) | ||
_, err := rand.Read(b) | ||
if err != nil { | ||
fmt.Fprintln(os.Stderr, "rand error: ", err) | ||
os.Exit(2) | ||
} | ||
_, err = encoded.Write(b) | ||
if err != nil { | ||
fmt.Fprintln(os.Stderr, "write error: ", err) | ||
os.Exit(3) | ||
} | ||
} |