-
Notifications
You must be signed in to change notification settings - Fork 721
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/unix: add some documentation and tidy up stubs
Document why the package exists, and how stubs will behave on non-Linux OS. Simplify constants for other OS by giving them a distinct but meaninless value. Always use type aliases for structs on Linux and remove boilerplate function comments.
- Loading branch information
Showing
3 changed files
with
87 additions
and
128 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 @@ | ||
// Package unix re-exports Linux specific parts of golang.org/x/sys/unix. | ||
// | ||
// It avoids breaking compilation on other OS by providing stubs as follows: | ||
// - Invoking a function always returns an error. | ||
// - Errnos have distinct, non-zero values. | ||
// - Constants have distinct but meaningless values. | ||
// - Types use the same names for members, but may or may not follow the | ||
// Linux layout. | ||
package unix | ||
|
||
// Note: please don't add any custom API to this package. Use internal/sys instead. |
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
Oops, something went wrong.