https://github.com/xaionaro-go/hackery
About builtin Golang magic comments
https://github.com/xaionaro-go/hackery
comment go golang internals magic
Last synced: about 2 months ago
JSON representation
About builtin Golang magic comments
- Host: GitHub
- URL: https://github.com/xaionaro-go/hackery
- Owner: xaionaro-go
- Created: 2019-03-19T15:50:08.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-25T16:48:36.000Z (over 6 years ago)
- Last Synced: 2025-03-30T22:32:12.042Z (about 1 year ago)
- Topics: comment, go, golang, internals, magic
- Homepage:
- Size: 1000 Bytes
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Magic comments
* [`//go:generate`](https://golang.org/pkg/cmd/go/internal/generate/)
* [`//go:linkname`](https://sitano.github.io/2016/04/28/golang-private/)
* [`//go:noescape`](https://dave.cheney.net/2018/01/08/gos-hidden-pragmas)
* [`//go:noinline`](https://dave.cheney.net/2018/01/08/gos-hidden-pragmas)
* [`//go:nosplit`](https://dave.cheney.net/2018/01/08/gos-hidden-pragmas)
* [`//go:norace`](https://dave.cheney.net/2018/01/08/gos-hidden-pragmas)
* [`//line`](https://dave.cheney.net/2018/01/08/gos-hidden-pragmas)
* [`// import`](https://dave.cheney.net/2018/01/08/gos-hidden-pragmas)
* [`//go:systemstack`](https://github.com/golang/go/blob/master/src/runtime/HACKING.md)
* [`//go:nowritebarrierrec`](https://github.com/golang/go/blob/master/src/runtime/HACKING.md)
* [`//go:yeswritebarrierrec`](https://github.com/golang/go/blob/master/src/runtime/HACKING.md)
* [`//go:notinheap`](https://github.com/golang/go/blob/master/src/runtime/HACKING.md)
# Hidden (but useful) functions
To use this functions you need to use `//go:linkname`.
* [`notewakeup`](https://lk4d4.darth.io/posts/go-timers/)
* [`getg`](https://github.com/golang/go/issues/18590)
# Guides
* [Reduce the size of a binary](https://github.com/xaionaro/documentation/blob/master/golang/reduce-binary-size.md)