...
1# go-winio [](https://github.com/microsoft/go-winio/actions/workflows/ci.yml)
2
3This repository contains utilities for efficiently performing Win32 IO operations in
4Go. Currently, this is focused on accessing named pipes and other file handles, and
5for using named pipes as a net transport.
6
7This code relies on IO completion ports to avoid blocking IO on system threads, allowing Go
8to reuse the thread to schedule another goroutine. This limits support to Windows Vista and
9newer operating systems. This is similar to the implementation of network sockets in Go's net
10package.
11
12Please see the LICENSE file for licensing information.
13
14## Contributing
15
16This project welcomes contributions and suggestions.
17Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that
18you have the right to, and actually do, grant us the rights to use your contribution.
19For details, visit [Microsoft CLA](https://cla.microsoft.com).
20
21When you submit a pull request, a CLA-bot will automatically determine whether you need to
22provide a CLA and decorate the PR appropriately (e.g., label, comment).
23Simply follow the instructions provided by the bot.
24You will only need to do this once across all repos using our CLA.
25
26Additionally, the pull request pipeline requires the following steps to be performed before
27mergining.
28
29### Code Sign-Off
30
31We require that contributors sign their commits using [`git commit --signoff`][git-commit-s]
32to certify they either authored the work themselves or otherwise have permission to use it in this project.
33
34A range of commits can be signed off using [`git rebase --signoff`][git-rebase-s].
35
36Please see [the developer certificate](https://developercertificate.org) for more info,
37as well as to make sure that you can attest to the rules listed.
38Our CI uses the DCO Github app to ensure that all commits in a given PR are signed-off.
39
40### Linting
41
42Code must pass a linting stage, which uses [`golangci-lint`][lint].
43The linting settings are stored in [`.golangci.yaml`](./.golangci.yaml), and can be run
44automatically with VSCode by adding the following to your workspace or folder settings:
45
46```json
47 "go.lintTool": "golangci-lint",
48 "go.lintOnSave": "package",
49```
50
51Additional editor [integrations options are also available][lint-ide].
52
53Alternatively, `golangci-lint` can be [installed locally][lint-install] and run from the repo root:
54
55```shell
56# use . or specify a path to only lint a package
57# to show all lint errors, use flags "--max-issues-per-linter=0 --max-same-issues=0"
58> golangci-lint run ./...
59```
60
61### Go Generate
62
63The pipeline checks that auto-generated code, via `go generate`, are up to date.
64
65This can be done for the entire repo:
66
67```shell
68> go generate ./...
69```
70
71## Code of Conduct
72
73This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
74For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
75contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
76
77## Special Thanks
78
79Thanks to [natefinch][natefinch] for the inspiration for this library.
80See [npipe](https://github.com/natefinch/npipe) for another named pipe implementation.
81
82[lint]: https://golangci-lint.run/
83[lint-ide]: https://golangci-lint.run/usage/integrations/#editor-integration
84[lint-install]: https://golangci-lint.run/usage/install/#local-installation
85
86[git-commit-s]: https://git-scm.com/docs/git-commit#Documentation/git-commit.txt--s
87[git-rebase-s]: https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---signoff
88
89[natefinch]: https://github.com/natefinch
View as plain text