Re: [go-nuts] Go 1.18: reflect implicit type conversion

2022-04-16 Thread Ian Lance Taylor
On Sat, Apr 16, 2022 at 2:09 AM 'Dan Kortschak' via golang-nuts wrote: > > This is not mentioned in the release notes. I think it is a bug in > 1.18; he docs still say that "As in Go, key's elem must be assignable > to the map's key type". This is not the case here. > > Bisected to 23832ba2e2fb396

[go-nuts] Re: MatrixOne: a hyperconverged and one-size-fits-most database in Go

2022-04-16 Thread Yingfeng Zhang
Currently we are working on the update features, and upsert has not been considered initially and will be done in future. On Saturday, April 16, 2022 at 4:42:41 PM UTC+8 yan.z...@gmail.com wrote: > Does it support sequence and upsert in PostgreSQL? > > 在2022年4月16日星期六 UTC+8 00:47:48 写道: > >> Hi,

[go-nuts] Re: MatrixOne: a hyperconverged and one-size-fits-most database in Go

2022-04-16 Thread Yingfeng Zhang
Hi, Brian, Thanks for your comments. Actually the MatrixOne is still in its infant stage, so it's far from being able to be compared with other alternatives in terms of ACID,...,etc. Current codebase is just a demo such that MPP sql execution engine could work together with both columnar stora

Re: [go-nuts] Any recipe to stop a goroutine of a function other than of a channel?

2022-04-16 Thread Brian Candler
For TCP sockets, there's SetDeadline, SetReadDeadline and SetWriteDeadline. See https://pkg.go.dev/net For the originally posted code, I would replace time.Sleep(5 * time.Second) with code which either waits 5 seconds, or terminates on a shutdown signal if that is received first. The idi

[go-nuts] SHA3 SHAKE on not byte aligned inupt

2022-04-16 Thread Paolo C.
As for SHA256/512, the SHAKE (and SHA3 in general) go implementation continues to be not fully in line with the RFCs/specification, because there is no way to have a HASH/SUM/MAC of inputs that are not aligned to the byte. Say, for example, 12 bits. Of course, padding before hashing cannot be th

Re: [go-nuts] Any recipe to stop a goroutine of a function other than of a channel?

2022-04-16 Thread roger peppe
I'm not sure what you think such a general feature might look like. In general, it's not a good idea to force an arbitrary thing to stop, because that can leave resources in an undefined state, so the only reasonable approach AFAICS is to ask the function that's running to stop. That functionality

Re: [go-nuts] Any recipe to stop a goroutine of a function other than of a channel?

2022-04-16 Thread Zhaoxun Yan
Thanks rog! I already dealt with it in my project since the Listen of gorilla websocket did as you just mentioned - close and even throw out an error. But I am surprised at why golang still has not provided a general feature on that. Zhaoxun On Sat, Apr 16, 2022 at 10:14 PM roger peppe wrote:

Re: [go-nuts] Any recipe to stop a goroutine of a function other than of a channel?

2022-04-16 Thread roger peppe
Most network functions provide a way to provide a timeout or cancellation explicitly. Listen is one such: see this method - if the context that it's passed is cancelled, the Listen call will return. https://pkg.go.dev/net#ListenConfig.Listen The most general way to stop waiting on timeout or cance

Re: [go-nuts] Any recipe to stop a goroutine of a function other than of a channel?

2022-04-16 Thread Robert Engels
2 options: put a timeout on the listen and loop. Close the socket it is listening on. > On Apr 16, 2022, at 8:30 AM, Zhaoxun Yan wrote: > >  > Timeout is quite common practice in programming. For example, Listen > function in internet connection with a timeout may just close the connection

[go-nuts] Any recipe to stop a goroutine of a function other than of a channel?

2022-04-16 Thread Zhaoxun Yan
Timeout is quite common practice in programming. For example, Listen function in internet connection with a timeout may just close the connection and Listen thread as silence persists for some period, like 60 seconds. I found it very hard to implement such a general shutdown feature of a thr

[go-nuts] Re: MatrixOne: a hyperconverged and one-size-fits-most database in Go

2022-04-16 Thread Brian Candler
On Friday, 15 April 2022 at 17:47:48 UTC+1 nicolas...@gmail.com wrote: > any feedback is welcome. > The only feedback I can give is from your reading your documentation, which appears at this point to be very vague. I was looking for a proper architectural white paper that says exactly what C

Re: [go-nuts] Loop unit char entered

2022-04-16 Thread Daniel Jankins
Thank you, That is what I did. It works very well. Thank you again On Fri, Apr 15, 2022 at 8:48 PM Kurtis Rader wrote: > On Fri, Apr 15, 2022 at 6:35 AM Daniel Jankins wrote: > >> I have a newbie question. I want to loop until a char is available >> (keypress). >> Could someone point me to an

Re: [go-nuts] Go 1.18: reflect implicit type conversion

2022-04-16 Thread 'Dan Kortschak' via golang-nuts
On Fri, 2022-04-15 at 18:33 -0700, Dave Keck wrote: > Hi all, > > In this code, the SetMapIndex line panics in Go <1.18, but it no > longer panics in Go 1.18: > > type CustomString string > m := reflect.ValueOf(map[CustomString]int{}) > m.SetMapIndex(reflect.ValueOf("key"), reflect.Valu

[go-nuts] Re: MatrixOne: a hyperconverged and one-size-fits-most database in Go

2022-04-16 Thread Zhaoxun Yan
Does it support sequence and upsert in PostgreSQL? 在2022年4月16日星期六 UTC+8 00:47:48 写道: > Hi, > > I’d like to introduce a hyperconverged and one-size-fits-most database > named MatrixOne, written in Go. > > Github: https://github.com/matrixorigin/matrixone > > It’s a redesigned database with a com