Go bindings
So far, we've looked at how to embed JavaScript packages into our Go code through GopherJS. However, that can get tedious, especially since there are lots of shared functionalities between JavaScript and Go packages. Luckily, GopherJS supports the conversion of most of Go's standard packages into JavaScript. The list of compatible Go packages can be found at https://github.com/gopherjs/gopherjs/blob/master/doc/packages.md.
Some of the packages, such as the os package, are only supported in Node.js environments. This is because most of the package operations are not meant for the browser.
For example, if you look at the list of compatible Go packages, you'll find the encoding/csv, fmt, and string packages as some of the supported ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access