Re: [go-nuts] A value saved in an interface{} field in a struct not usable in func with interace{} arg

2021-01-11 Thread Steve Murphy
Many thanks, Ian, I appreciate your suggestions! I added your code snippet to my program, and got: panic: interface conversion: interface {} is nil, not *interface {} [recovered] panic: interface conversion: interface {} is nil, not *interface {} According to the trace, it looks like it's crash

Re: [go-nuts] Need to read file in double loop

2021-01-11 Thread Kurtis Rader
You should start by asking yourself why your program outputs "1", "2" and "S". Hint: after seeing "S" you don't break out of the inner loop until another "S" is seen which your sample data does not include. On Mon, Jan 11, 2021 at 6:59 PM Tong Sun wrote: > Hi, > > I need to read file in double l

[go-nuts] Need to read file in double loop

2021-01-11 Thread Tong Sun
Hi, I need to read file in double loop -- - reading file line by line until a special KW is met, say "S" - When it happens, need to collect content line by line until another special KW is met, say "E" For e.g., if processing the following content line by line, then the content from S 3 till

[go-nuts] Using fetch() for HTTP requests?

2021-01-11 Thread Nv7
I am making a WebAssembly app with Go. Currently, it is 8.1MB uncompressed and 2MB gzipped. This is too much. I want to use TinyGo, but I need to send HTTP GET requests. TinyGo currently doesn't support net/http. But, TinyGo has syscall/js which allows you to do fetch(). But I couldn't find ou

Re: [go-nuts] Using go tool with third-party Go implementations

2021-01-11 Thread Alexander Zhirov
> I suspect this will give you trouble over time. That's the question I've been pondering a lot lately. I know for sure that trying to keep up with the go tool evolution *is* a lot of trouble. I'm trying to experiment with alternatives to get some sense for how they actually compare. Using go/bu

Re: [go-nuts] Using go tool with third-party Go implementations

2021-01-11 Thread Ian Lance Taylor
On Mon, Jan 11, 2021 at 11:03 AM Alexander Zhirov wrote: > > At the moment there are at least three alternative implementations of Go that > I know of (and there are probably some I don't): gccgo, tinygo and gopherjs. > Of the three, only gccgo is supported by the go tool out of box. Looking at

[go-nuts] Using go tool with third-party Go implementations

2021-01-11 Thread Alexander Zhirov
Hi all, At the moment there are at least three alternative implementations of Go that I know of (and there are probably some I don't): gccgo, tinygo and gopherjs. Of the three, only gccgo is supported by the go tool out of box. Looking at the source code, gc ang gccgo have their own implementat

Re: [go-nuts] A value saved in an interface{} field in a struct not usable in func with interace{} arg

2021-01-11 Thread Ian Davis
In genBox your code is saying that val contains a pointer to interface{}. In other words its an interface{} that contains a *interface{}. That is a weird but valid construct. I suggest you dereference it and see what the contained interface holds. Something like: valDeref := val.(*interface{})

[go-nuts] A value saved in an interface{} field in a struct not usable in func with interace{} arg

2021-01-11 Thread Steve Murphy
Hello! I keep getting: panic: interface conversion: interface {} is *interface {}, not *int64 [recovered] panic: interface conversion: interface {} is *interface {}, not *int64 I *suspect* what is happening is that the KDElem struct has an item field whose type is interface{}, so that you can sto

Re: [go-nuts] Golang vs Python: Complete Comparison with their Top Frameworks

2021-01-11 Thread Nikolay Dubina
I would expected to see at these two things: 1. That most of the serious solutions in "Python" are actually wrappers for highly optimized machinery in C/C++. If you look at just basic ML stack: Pytorch, Tensorflow, OpenCV, numpy, scipy, XGBoost, so on. all is in C/C++ with wrapper in Python. 2.