From 9e3799a275a9ac6a369a11f7bb37ddffd8dd1c81 Mon Sep 17 00:00:00 2001 From: a Date: Tue, 20 Jun 2017 21:47:10 +0200 Subject: [PATCH] Mention Go lang and possible integration --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/README.md b/README.md index 4b522ec..694f99a 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ The code doesn't age, neither it has expiration date. - [BSD Requirements](#bsd-mandatory-requirements) - [Opt-in Requirements](#opt-in-requirements) - [WM Requirements](#wm-specific-requirements) +- [Go lang](#go-lang) - [Wish list](#wish-list) --- @@ -754,6 +755,53 @@ use **--without-colours** to skip the following step: * dwm compiled with statuscolor patch. The colours in use are specified in your dwm config.h +--- + +## Go lang + +By default I decided not to include Go lang, but this doesn't mean you cannot do it by hand: + +```c +/* test.c */ +#include +#include +#include + +#include "hello.h" + +int main(void) { + HelloWorld(); + return EXIT_SUCCESS; +} +``` + +**hello.go** + +```go +package main + +import "fmt" +import "C" + +//export HelloWorld +func HelloWorld() { + fmt.Printf("Hello %d", 123) +} + +func main() {} +``` + +build it with: + +```bash +go build -buildmode=c-archive hello.go +gcc -pthread test.c hello.a -o test +# test it with: +./test +``` + +Obviously the Go code should return string when you make it into standalone module. It's easy to add the above code into standalone module that can be used by pinky-bar. + ## Wish list It would be great if I had \*BSD compatible usb wifi dongle or wireless pci adapter to add wifi options in pinky-bar. -- 2.11.0