Re: [go-nuts] Re: implementing macro in plan 9 assembly

2020-10-16 Thread Joop Kiefte
I think you can use nasm assembly through inline ASM in cgo indirectly... Go supports writing .s-files written in Go's internal assembly format, which should be much faster than cgo to compile and is probably preferable, but needs a bit of learning. [Joop Kiefte - Chat @ Spike](https

Re: [go-nuts] Re: implementing macro in plan 9 assembly

2020-10-16 Thread Joop Kiefte
I don't know how this should actually be done, but remember that the Go assembly is not actually Plan 9 assembly, it's an abstraction by itself, meant for internal use first and foremost. [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=q9y39) [q

Re: [go-nuts] database/sql works when run it, but with test it complains about unknown driver

2020-10-15 Thread Joop Kiefte
You basically have to see the test file as an alternative package main, which can but (generally?) does not have to have access to the contents of the main package, as such you don't have access to the drivers by default... [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike

Re: [go-nuts] database/sql works when run it, but with test it complains about unknown driver

2020-10-15 Thread Joop Kiefte
I mean the full command that has the connection string in it, most importantly the driver string. Sorry for not putting that as clearly as I could... [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=q8f5w) [q8f5w] On October 15, 2020 at 16:19 GMT, f

Re: [go-nuts] database/sql works when run it, but with test it complains about unknown driver

2020-10-15 Thread Joop Kiefte
Just a hunch, what does your connection string look like? [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=q87fr) [q87fr] On October 15, 2020 at 13:30 GMT, farid sobhany wrote: I have searched the whole application for that import, and I couldn't

Re: [go-nuts] Re: syscall/js: JS Module Dynamic Imports?

2020-10-05 Thread Joop Kiefte
the environment of the wasm decides what you have access to, so you might want to add the import in the HTML around it instead. [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=pq35q) [pq35q] On October 5, 2020 at 18:03 GMT, Eduard Castany wrote:

Re: [go-nuts] Re: Proper way of mocking interfaces in unit tests - the golang way

2020-10-03 Thread Joop Kiefte
. having it crash the program. The Go way of doing it is putting it away from the main program, keeping the main program always safe to run. The testify assert copies semantics but not these problems, so there is no issue at all using it. [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref

Re: [go-nuts] cgo: how to generate crash report/coredump on macOS for SIGSEGV

2020-10-01 Thread Joop Kiefte
CGo is not Go -- C-land crash information fully depends on your C-compiler. [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=pj5l7) [pj5l7] On October 2, 2020 at 0:39 GMT, aihui zhu wrote: I have enabled coredump with `ulimit -c unlimited`, and

Re: [go-nuts] Exec and write data to stdin of new process

2020-09-30 Thread Joop Kiefte
if the target program is under your control, you can just write to a file, write the location to that file to the stdin and pick up from the file in the target... [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=ph9ch) [ph9ch] On October 1, 2020

Re: [go-nuts] Re: protobuf avoid namespace conflict

2020-09-30 Thread Joop Kiefte
I suppose the best way is to use namespaced naming for the imported packages [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=pgu9m) [pgu9m] On September 30, 2020 at 17:47 GMT, Denis Cheremisov wrote: It is because you import protoc-gen-go gener

Re: [go-nuts] Re: protobuf avoid namespace conflict

2020-09-30 Thread Joop Kiefte
(example code would help to give more specific advice...). [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=pgfpn) [pgfpn] On September 30, 2020 at 13:26 GMT, Vasiliy Tolstov wrote: So nobody knows how to deal with this? And if some projects have p

Re: [go-nuts] Re: syscall/js: JS Module Dynamic Imports?

2020-09-29 Thread Joop Kiefte
I think that's pretty recent? The only way used to be to add a script tag, and I have used that in Go before. I think just putting it in as a function call might work though... [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=pengd) [p

Re: [go-nuts] Re: Go API receive calls twice when hit through browser

2020-09-27 Thread Joop Kiefte
mind: there are more well-known locations, they are just not as common as the favicon call, so you might just want to be specific on where you expect your API calls and only listen on that. [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=pb5kd) [p

Re: [go-nuts] Re: Go API receive calls twice when hit through browser

2020-09-27 Thread Joop Kiefte
probably the best solution is to use the handlers and not listen on any other link than your API links, then the favicon request won't hit your service. You don't even really have to return a 200, just make sure you don't answer to favicon.ico requests the very least. [Joop Kiefte - Chat

Re: [go-nuts] EC crypto: Equivalent of EC_POINT_invert() in go?

2020-09-25 Thread Joop Kiefte
https://www.openssl.org/docs/man1.1.0/man3/EC_POINT_invert.html I found this, that might help you on the way... It's defined in this file: https://github.com/openssl/openssl/blob/67ecd65cc4fdaa03fbae5fcccf53ebca7d785554/crypto/ec/ec_lib.c [Joop Kiefte - Chat @ Spike](https://spikenow.com/r

Re: [go-nuts] Re: Go API receive calls twice when hit through browser

2020-09-25 Thread Joop Kiefte
The browser tries to put a nice icon to the side of the link. Usually this can be accomplished with a meta tag, but the browser also tries the well-known location favicon.ico to retrieve it if there is no meta-tag. That's why you see two requests. [Joop Kiefte - Chat @ Spike](https

Re: [go-nuts] loadinternal: cannot find runtime/cgo

2020-09-25 Thread Joop Kiefte
So I suspect then that some environment variables are not configured correctly -- the problem from the errors is the files not being found, this doesn't necessarily mean that they are not there... [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=p

Re: [go-nuts] loadinternal: cannot find runtime/cgo

2020-09-25 Thread Joop Kiefte
Yep, that's basically what it comes down to: using the same Go version as the original author. I think making it work with the latest version would be possible, but might need adaptations. [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=p6sdb) [p

Re: [go-nuts] loadinternal: cannot find runtime/cgo

2020-09-24 Thread Joop Kiefte
As far as I know, this is a demo that relies on internals that are not part of the official API, so there are probably mismatches because of that. Maybe try with an older Go version first? Also, how did you install Go itself? Maybe the GOROOT is not set up correctly for example? [Joop Kiefte

Re: [go-nuts] global goroutine data / thread local storage?

2020-09-23 Thread Joop Kiefte
As far as I know, that is exactly what the Context package and customs are meant for. [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=p4aw3) [p4aw3] On September 24, 2020 at 0:17 GMT, Alex Mills wrote: Since by default all http requests co

Re: [go-nuts] Cross compiling for linux from dawin

2020-09-22 Thread Joop Kiefte
Quick guess, the dependencies the CGo in that library tries to link with are not the correct version and as such lack some definitions? Try updating the C dependency source if possible to a later or corresponding version, if that makes sense? [Joop Kiefte - Chat @ Spike](https://spikenow.com

Re: [go-nuts] How to clear current line in terminal

2020-09-19 Thread Joop Kiefte
func clearCurrentLine(){ fmt.Print("\n\033[1A\033[K") } [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=owk7j) [owk7j] On September 19, 2020 at 20:04 GMT, Joop Kiefte wrote: package main import "fmt" func main() { fmt.Print

Re: [go-nuts] How to clear current line in terminal

2020-09-19 Thread Joop Kiefte
package main import "fmt" func main() { fmt.Println("Test 1") fmt.Println("Test 2") fmt.Print("\033[1A\033[K") //one up, remove line (should work after the newline of the Println) } Maybe this piece of code helps you? [Joop Kiefte - Chat @ Spike](htt

Re: [go-nuts] How to clear current line in terminal

2020-09-19 Thread Joop Kiefte
Can you give some example code? [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=owiru) [owiru] On September 19, 2020 at 19:29 GMT, Alex Mills wrote: Yeah I tried all those ANSI codes, nothing seems to work :( On Sat, Sep 19, 2020 at 11:59 AM

Re: [go-nuts] How to clear current line in terminal

2020-09-19 Thread Joop Kiefte
I tend to do that with ANSI terminal codes, there are pages that explain all codes [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=owh4j) [owh4j] On September 19, 2020 at 18:44 GMT, Alex Mills wrote: Using Node.js with several projects I can

Re: [go-nuts] RISCV & Golang custom-compilations ahead?

2020-09-13 Thread Joop Kiefte
I think because of the very modular design of the Go compiler, adapting it to work better for any specific RISCV variant would basically be trivial compared to other complicated compiler designs. [Joop Kiefte - Chat @ Spike](https://spikenow.com/r/a/?ref=spike-organic-signature&_ts=o