Re: [go-nuts] GO program - RISCV Environment - Segmentation violation

2022-03-21 Thread Ian Lance Taylor
On Mon, Mar 21, 2022 at 6:58 PM Jagan Sivakumar wrote: > > Trying to run a sample GO program cross compiled to RISCV platform. > Getting segmentation violation issues when performing read and write > in a large array list. > Kindly let me know how to address the issue > > Sample GO Program: > pack

Re: [go-nuts] GO program - RISCV Environment - Segmentation violation

2022-03-21 Thread Jagan Sivakumar
HI Ian Thanks for your quick response. Send the mail in plain text mode. Trying to run a sample GO program cross compiled to RISCV platform. Getting segmentation violation issues when performing read and write in a large array list. Kindly let me know how to address the issue Sample GO Program: p

[go-nuts] Re: Goroutines - handles, signals, and signal handlers

2022-03-21 Thread 'Kevin Chowski' via golang-nuts
In Go, goroutines are meant to explicitly signal each other; further, it seems very intentional that goroutines are never interrupted in the middle of execution like an interrupt service routine might in a lower-level situation. It was mentioned in a prior message a bit, but to add more details

Re: [go-nuts] Generics question

2022-03-21 Thread 'Axel Wagner' via golang-nuts
This is brought up in the release notes: https://tip.golang.org/doc/go1.18#generics The Go compiler only supports calling a method m on a value x of type > parameter type P if m is explicitly declared by P's constraint interface. > Similarly, method values x.m and method expressions P.m also are o

[go-nuts] Generics question

2022-03-21 Thread Sankar P
I have the following code snippet. type workloadInterface interface { *appsV1.Deployment | *appsV1.StatefulSet } . . . func (a *adapter) processDepOrSSForSvc(client kubernetes.Interface, ns, svcName, workloadName, svcVersionType string) { switch svcVersionType { c

[go-nuts] Re: Is there a way to eliminate the code repetition in the code?

2022-03-21 Thread Henry
Perhaps something like this? ```go func Convert[T, A any](src []T, converter func(T) A) []A { result := make([]A, len(src)) for index, a := range src { result[index] = converter(a) } return result } ``` See https://play.golang.com/p/rq89Wposc-D On Su