https://github.com/andreiavrammsd/cgo-examples
Examples of calling C code from Go
https://github.com/andreiavrammsd/cgo-examples
c cgo go
Last synced: 22 days ago
JSON representation
Examples of calling C code from Go
- Host: GitHub
- URL: https://github.com/andreiavrammsd/cgo-examples
- Owner: andreiavrammsd
- Created: 2019-11-01T22:21:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2025-04-25T16:04:40.000Z (about 1 month ago)
- Last Synced: 2025-05-07T04:45:41.359Z (22 days ago)
- Topics: c, cgo, go
- Language: Go
- Homepage: https://blog.andreiavram.ro/golang-cgo-examples/
- Size: 4.88 KB
- Stars: 30
- Watchers: 1
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CGO Examples
Examples of calling C code from Go (including a test C library). Passing and getting numbers, strings, enums, structs, callbacks.
### Build and run Docker env
```bash
make env
```### Compile and run app
```bash
make
```See [Makefile](Makefile)
### Docs
* https://golang.org/cmd/cgo/
* https://blog.golang.org/c-go-cgo
* https://github.com/golang/go/wiki/cgo
* https://gist.github.com/zchee/b9c99695463d8902cd33
* https://dev.to/mattn/call-go-function-from-c-function-1n3