Using C Dynamic Libraries In Go Programs
goinggo.net
Using C Dynamic Libraries In Go Programs
1–10 of 12 posts
Re: Using C Dynamic Libraries In Go Programs
#2Re: Using C Dynamic Libraries In Go Programs
#3I wonder why the author didn't just read() in bytes from STDIN_FILENO? No need to use stuff like fget*.
cat /dev/fd/0
then type some things including backspace and enter.However, you don't need ncurses to change this behavior. termios is the lower-level C API. You can do it from Go with the syscall APIs but I suspect it might be frustrating to make portable. https://code.google.com/p/go/source/browse/ssh/terminal/util...
Re: Using C Dynamic Libraries In Go Programs
#4Re: Using C Dynamic Libraries In Go Programs
#5Coming from a C background, I was pretty disgusted with the "hack" of adding the include files in a comment before 'import C'. But then, even though they look similar, Go doesn't treat comments like C does, where they're eliminated by the C preprocessor and completely invisible to the source.
Re: Using C Dynamic Libraries In Go Programs
#6I wonder why the author didn't just read() in bytes from STDIN_FILENO? No need to use stuff like fget*.
I think by default your terminal is in "cooked" mode, where stdin is buffered a line at a time. Try cat /dev/fd/0 then type some things including backspace and enter. However, you don't need ncurses to change this behavior. termios is the lower-level C API. You can do it from Go with the syscall APIs but I suspect it might be frustrating to make portable. https://code.google.com/p/go/source/browse/ssh/terminal/util..…
Re: Using C Dynamic Libraries In Go Programs
#7Coming from a C background, I was pretty disgusted with the "hack" of adding the include files in a comment before 'import C'. But then, even though they look similar, Go doesn't treat comments like C does, where they're eliminated by the C preprocessor and completely invisible to the source.
Re: Using C Dynamic Libraries In Go Programs
#8I wonder why the author didn't just read() in bytes from STDIN_FILENO? No need to use stuff like fget*.
I think by default your terminal is in "cooked" mode, where stdin is buffered a line at a time. Try cat /dev/fd/0 then type some things including backspace and enter. However, you don't need ncurses to change this behavior. termios is the lower-level C API. You can do it from Go with the syscall APIs but I suspect it might be frustrating to make portable. https://code.google.com/p/go/source/browse/ssh/terminal/util..…
Re: Using C Dynamic Libraries In Go Programs
#9I wonder why the author didn't just read() in bytes from STDIN_FILENO? No need to use stuff like fget*.
I think by default your terminal is in "cooked" mode, where stdin is buffered a line at a time. Try cat /dev/fd/0 then type some things including backspace and enter. However, you don't need ncurses to change this behavior. termios is the lower-level C API. You can do it from Go with the syscall APIs but I suspect it might be frustrating to make portable. https://code.google.com/p/go/source/browse/ssh/terminal/util..…