https://github.com/fasterthanlime/whatever
Rust / C / Cgo example
https://github.com/fasterthanlime/whatever
Last synced: about 1 year ago
JSON representation
Rust / C / Cgo example
- Host: GitHub
- URL: https://github.com/fasterthanlime/whatever
- Owner: fasterthanlime
- Created: 2021-06-29T17:02:48.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-29T17:05:31.000Z (almost 5 years ago)
- Last Synced: 2025-04-01T03:13:25.835Z (about 1 year ago)
- Language: Rust
- Size: 1.2 MB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# whatever
## How to build
(This has been tested on Linux & macOS)
Build the Rust code:
```shell
$ cargo build
```
The library is in `./target/debug/libwhatever.a`
Build the Go code:
```shell
$ cd go-code/
$ go clean
$ go build -v -x .
```
Run the Go code:
```shell
$ ./whatever
```
It should print something like:
```
2021/06/29 19:01:51 Hello from Go
Hello from Rust or whatever. Your string is: The moonlight 🦜
2021/06/29 19:01:51 Rust gave us this string: Yeah allocations, sure
2021/06/29 19:01:51 Rust took back this string: P/, sure
```