[go-nuts] [gollvm] Build failed: error: undefined reference to 'runtime_1internal_1syscall.setErrno'

2022-02-23 Thread Richiise Nugraha
Hi, i encountered this error while compiling the gollvm, wonder if there is something missing: llvm commit: 09629215c272f09e3ebde6cc7eac9625d28910ff gollvm commit: 6cd24cbc9ce21c0e6c74551e356c9323f1b1afaf gofrontend commit: aee8eddbfc3ef1b03353a060e79e7d668fb229e2 libffi commit: ab1677106605aba1c

[go-nuts] [gollvm] Build failed: undefined reference to 'runtime_1internal_1syscall.setErrno'

2022-02-23 Thread Richiise Nugraha
Hi, tried to build gollvm but encountered this error: libbacktrace commit: 2446c66076480ce07a6bd868badcbceb3eeecc2e libffi commit: ab1677106605aba1c27665964ff90bea59612ce3 gollvm commit: 6cd24cbc9ce21c0e6c74551e356c9323f1b1afaf gofrontend commit: aee8eddbfc3ef1b03353a060e79e7d668fb229e2 llvmorg c

[go-nuts] [gollvm]: Build failed: error: undefined reference to 'runtime_1internal_1syscall.setErrno'

2022-02-23 Thread Richiise Nugraha
Hi, tried to build gollvm but encountered this error: libbacktrace commit: 2446c66076480ce07a6bd868badcbceb3eeecc2e libffi commit: ab1677106605aba1c27665964ff90bea59612ce3 gollvm commit: 6cd24cbc9ce21c0e6c74551e356c9323f1b1afaf gofrontend commit: aee8eddbfc3ef1b03353a060e79e7d668fb229e2 llvmorg co

[go-nuts] Golang interface union type parameter

2022-03-12 Thread Richiise Nugraha
Is Go type parameter supports interface union? My case type MessageSpec interface { MessageA | MessageB } type MessageA interface { ID() uint64 } type MessageB interface { Uid() uint64 } but got compile error: ./prog.go:14:2: cannot use main.MessageA in union (main.MessageA contains methods) ./

[go-nuts] Re: Golang interface union type parameter

2022-03-12 Thread Richiise Nugraha
https://go.dev/play/p/SgTiaeE9J2b?v=gotip Pada Sabtu, 12 Maret 2022 pukul 23.57.35 UTC+7 Richiise Nugraha menulis: > Is Go type parameter supports interface union? > > My case > type MessageSpec interface { MessageA | MessageB } > type MessageA interface { ID() uint64 }

[go-nuts] Re: Golang interface union type parameter

2022-03-12 Thread Richiise Nugraha
OK seems i already got the answer https://github.com/golang/go/issues/45346#issuecomment-862505803 https://github.com/golang/go/issues/49054 Pada Minggu, 13 Maret 2022 pukul 00.14.22 UTC+7 Richiise Nugraha menulis: > https://go.dev/play/p/SgTiaeE9J2b?v=gotip > > Pada Sabtu, 12 Maret 2

[go-nuts] checkptr/race pointer arithmetic result to invalid allocation

2022-07-08 Thread Richiise Nugraha
Hi, i was testing this code on Go playground and it works just fine, however if i run with `-race` it throws `pointer arithmetic result points to invalid allocation` although it has the same address. What really causes this?, like the address (untouched) still a valid allocation ptr = 0xc000138

[go-nuts] Go build but module-aware mode

2022-07-20 Thread Richiise Nugraha
Hi, is there any way to build source from given path@version just like `go run` and `go mod`? What i got: > go build -o main_x github.com//@latest package github.com//@latest: can only use path@version syntax with 'go get' and 'go install' in module-aware mode (and maybe putting

[go-nuts] How Go Compiler oprimize method with value or pointer receiver/functions

2022-10-08 Thread Richiise Nugraha
Hi all, I have a few question regarding Go compiler optimizations. How Go Compiler (gc) optimize methods with value or pointer receiver (or functions)? Does a method with value receiver always create a copy of data to its stack or the copy happend if there's a write attempt to it (CoW, or used f

[go-nuts] Zero-sized data type

2022-10-12 Thread Richiise Nugraha
Hi, I am looking for zero-sized data type, something like Flexible Array Member. The size of `struct {}` is indeed zero, but for what reason when it's inside a struct with another member say (https://go.dev/play/p/DpydJIke7dS): type C struct { Pre uint64 Inner struct{} } That struct s

Re: [go-nuts] Zero-sized data type

2022-10-13 Thread Richiise Nugraha
er 12, 2022 at 7:27:14 PM UTC+2 > axel.wa...@googlemail.com wrote: > >> You can re-order the fields to get the desired effect: >> https://go.dev/play/p/E1KTqVp0i-v >> >> On Wed, Oct 12, 2022 at 6:01 PM Richiise Nugraha >> wrote: >> >>> Hi, I am lo