[go-nuts] GOOS=js/GOARCH=wasm

2021-07-27 Thread W. Michael Petullo
I have been building applications using the GOOS=js/GOARCH=wasm for around two years. I really like being able to write both client and server code in Go. I have four questions that I have not yet found a clear answer for: (1) The syscall/js package is marked EXPERIMENTAL. Is there any consensus

[go-nuts] WebAssembly and Goroutines

2020-11-17 Thread W. Michael Petullo
I am having trouble understanding the model for Goroutines within WebAssembly. I have a "click" callback with the following form: errChan := make(chan error, 1) go func() { // Call http.PostForm and read response. if err != nil {

Re: [go-nuts] Generating Mermaid graph in web assembly

2020-04-02 Thread W. Michael Petullo
>> I have been using Go to define programs that I compile to web assembly. >> This works well in general, but I do not yet understanding how to express >> mermaid graphs (https://mermaid-js.github.io/mermaid/) from Go. >> [...] > I don't know mermaid but it sounded interesting so I took a look, an

[go-nuts] Generating Mermaid graph in web assembly

2020-04-02 Thread W. Michael Petullo
I have been using Go to define programs that I compile to web assembly. This works well in general, but I do not yet understanding how to express mermaid graphs (https://mermaid-js.github.io/mermaid/) from Go. A hard-coded graph looks like this: graph TD; A-->B;

[go-nuts] EAGAIN from Run is an os.PathError?

2020-03-28 Thread W. Michael Petullo
I am playing with Go and setrlimit(). Here is some code from a test that executes after setting RLIMIT_NPROC to 0: err = exec.Command("true").Run() if e, ok := err.(*os.PathError); !ok || e.Err.(unix.Errno) != unix.EAGAIN { t.Error(err.Error()) } /* Test succ

Re: [go-nuts] Go NaCl and C NaCl/libsodium

2019-07-14 Thread W. Michael Petullo
> Does anyone have any sample code which shows interoperability between Go's > golang.org/x/crypto/nacl/box and C's NaCl or libsodium? I have been having > trouble boxing with Go and opening with NaCl (and vice versa). I have used > NaCl from C a lot, but the Go NaCl packages are new to me. I am