detached d99d2be

examples/libc: reorder OSes in alphabetical order (#307)

This change also updates README by removing NetBSD.
commit
d99d2bef7bd53bf6bdd93512c2b3c3ede605192e
author
Hajime Hoshi · · 2025-03-19 19:23 UTC
committer
GitHub · · 2025-03-19 19:23 UTC
parent
1b61881
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
2 files · +4 -6
M README.md +2 -4
@@ -35,8 +35,8 @@ except for float arguments and return values.
3535
3636 ## Example
3737
38-The example below only showcases purego use for macOS, and Linux. The other platforms require special handling which can
39-be seen in the complete example at [examples/libc](https://github.com/ebitengine/purego/tree/main/examples/libc) which supports Windows and FreeBSD.
38+The example below only showcases purego use for macOS and Linux. The other platforms require special handling which can
39+be seen in the complete example at [examples/libc](https://github.com/ebitengine/purego/tree/main/examples/libc) which supports FreeBSD and Windows.
4040
4141 ```go
4242 package main
@@ -54,8 +54,6 @@ func getSystemLibrary() string {
5454 return "/usr/lib/libSystem.B.dylib"
5555 case "linux":
5656 return "libc.so.6"
57- case "netbsd":
58- return "libc.so"
5957 default:
6058 panic(fmt.Errorf("GOOS=%s is not supported", runtime.GOOS))
6159 }
@@ -35,8 +35,8 @@ except for float arguments and return values.
35 35
36 ## Example36 ## Example
37 37
38-The example below only showcases purego use for macOS, and Linux. The other platforms require special handling which can38+The example below only showcases purego use for macOS and Linux. The other platforms require special handling which can
39-be seen in the complete example at [examples/libc](https://github.com/ebitengine/purego/tree/main/examples/libc) which supports Windows and FreeBSD.39+be seen in the complete example at [examples/libc](https://github.com/ebitengine/purego/tree/main/examples/libc) which supports FreeBSD and Windows.
40 40
41 ```go41 ```go
42 package main42 package main
@@ -54,8 +54,6 @@ func getSystemLibrary() string {
54 return "/usr/lib/libSystem.B.dylib"54 return "/usr/lib/libSystem.B.dylib"
55 case "linux":55 case "linux":
56 return "libc.so.6"56 return "libc.so.6"
57- case "netbsd":
58- return "libc.so"
59 default:57 default:
60 panic(fmt.Errorf("GOOS=%s is not supported", runtime.GOOS))58 panic(fmt.Errorf("GOOS=%s is not supported", runtime.GOOS))
61 }59 }
M examples/libc/main.go +2 -2
@@ -16,10 +16,10 @@ func getSystemLibrary() string {
1616 switch runtime.GOOS {
1717 case "darwin":
1818 return "/usr/lib/libSystem.B.dylib"
19- case "linux":
20- return "libc.so.6"
2119 case "freebsd":
2220 return "libc.so.7"
21+ case "linux":
22+ return "libc.so.6"
2323 case "netbsd":
2424 return "libc.so"
2525 case "windows":
@@ -16,10 +16,10 @@ func getSystemLibrary() string {
16 switch runtime.GOOS {16 switch runtime.GOOS {
17 case "darwin":17 case "darwin":
18 return "/usr/lib/libSystem.B.dylib"18 return "/usr/lib/libSystem.B.dylib"
19- case "linux":
20- return "libc.so.6"
21 case "freebsd":19 case "freebsd":
22 return "libc.so.7"20 return "libc.so.7"
21+ case "linux":
22+ return "libc.so.6"
23 case "netbsd":23 case "netbsd":
24 return "libc.so"24 return "libc.so"
25 case "windows":25 case "windows":

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