detached e145907

purego: clean up some code (#123)

commit
e1459079498f0551770af3cedc2903b3f3e3c7b2
author
Hajime Hoshi · · 2023-04-03 19:33 UTC
committer
GitHub · · 2023-04-03 19:33 UTC
parent
b4a1f66
signature
GPG Unverified4AEE18F83AFDEB23 The key is unknown
refs
tag: v0.4.0-alpha.2
1 file · +2 -3
M dlfcn_test.go +2 -3
@@ -129,9 +129,8 @@ func buildSharedLib(compilerEnv, libFile string, sources ...string) error {
129129 // macOS arm64 can run amd64 tests through Rossetta.
130130 // Build the shared library based on the GOARCH and not
131131 // the default behavior of the compiler.
132- var archFlag, arch string
133132 if runtime.GOOS == "darwin" {
134- archFlag = "-arch"
133+ var arch string
135134 switch runtime.GOARCH {
136135 case "arm64":
137136 arch = "arm64"
@@ -140,7 +139,7 @@ func buildSharedLib(compilerEnv, libFile string, sources ...string) error {
140139 default:
141140 return fmt.Errorf("unknown macOS architecture %s", runtime.GOARCH)
142141 }
143- args = append(args, archFlag, arch)
142+ args = append(args, "-arch", arch)
144143 }
145144 cmd := exec.Command(compiler, append(args, sources...)...)
146145 if out, err := cmd.CombinedOutput(); err != nil {
@@ -129,9 +129,8 @@ func buildSharedLib(compilerEnv, libFile string, sources ...string) error {
129 // macOS arm64 can run amd64 tests through Rossetta.129 // macOS arm64 can run amd64 tests through Rossetta.
130 // Build the shared library based on the GOARCH and not130 // Build the shared library based on the GOARCH and not
131 // the default behavior of the compiler.131 // the default behavior of the compiler.
132- var archFlag, arch string
133 if runtime.GOOS == "darwin" {132 if runtime.GOOS == "darwin" {
134- archFlag = "-arch"133+ var arch string
135 switch runtime.GOARCH {134 switch runtime.GOARCH {
136 case "arm64":135 case "arm64":
137 arch = "arm64"136 arch = "arm64"
@@ -140,7 +139,7 @@ func buildSharedLib(compilerEnv, libFile string, sources ...string) error {
140 default:139 default:
141 return fmt.Errorf("unknown macOS architecture %s", runtime.GOARCH)140 return fmt.Errorf("unknown macOS architecture %s", runtime.GOARCH)
142 }141 }
143- args = append(args, archFlag, arch)142+ args = append(args, "-arch", arch)
144 }143 }
145 cmd := exec.Command(compiler, append(args, sources...)...)144 cmd := exec.Command(compiler, append(args, sources...)...)
146 if out, err := cmd.CombinedOutput(); err != nil {145 if out, err := cmd.CombinedOutput(); err != nil {

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close