Re: [go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-12 Thread Rob Pike
Thanks for the tip. A fairly straightforward implementation of this algorithm gives me about a factor of two speedup for pretty much any value. I went up to 1e8!, which took about half an hour compared to nearly an hour for MulRange. I'll probably stick in ivy after a little more tuning. I may

Re: [go-nuts] How could we emulate condition variables using Go channels only?

2024-01-12 Thread Rochus Keller
> Something like this? https://go.dev/play/p/_H3kFjprAGG No, sorry. The goal is to emulate a full monitor just with channels, as demonstrated in the referenced text (see the Stack example). The Mutex is likely correct, but the Signal has yet to pass the scrutinity of the folks here. -- You

Re: [go-nuts] How could we emulate condition variables using Go channels only?

2024-01-12 Thread Jan Mercl
On Fri, Jan 12, 2024 at 7:57 PM Rochus Keller wrote: > Here is the full question with examples (though meanwhile closed as usual in > recent times on stackoverflow, so answer here please): >

[go-nuts] How could we emulate condition variables using Go channels only?

2024-01-12 Thread Rochus Keller
Here is the full question with examples (though meanwhile closed as usual in recent times on stackoverflow, so answer here please): https://stackoverflow.com/questions/77802102/mutex-and-condition-variables-in-go-without-using-the-sync-package This is a conceptual question based on the duality

Re: [go-nuts] Re: Rendering fonts in Go

2024-01-12 Thread Jan Mercl
On Fri, Jan 12, 2024 at 12:34 PM 'Brian Candler' via golang-nuts wrote: > At worst, it may possible to compile C into Go. It sounds mad, but I believe > SQLite has been ported to pure Go this way. Challenge accepted: https://pkg.go.dev/modernc.org/libfreetype -- You received this message

[go-nuts] pauseEnd times in runtime.Memstats

2024-01-12 Thread Michael Mitchell
In runtime.Memstates, one of the stats given is the timestamps for the last 256 garbage collections in the PauseEnd array, i.e. when those garbage collections took place. So if you subtract one timestamp from another, you can find out how much time took place between garbage collections. Is

[go-nuts] Re: Rendering fonts in Go

2024-01-12 Thread 'Brian Candler' via golang-nuts
At worst, it may possible to compile C into Go. It sounds mad, but I believe SQLite has been ported to pure Go this way. https://pkg.go.dev/modernc.org/sqlite https://twitter.com/bradfitz/status/855271867162083329?lang=en https://groups.google.com/g/golang-nuts/c/QDEczMhlQBU/m/4lCn2kP0AwAJ

[go-nuts] gotip tool dist test -race may not have making effective use of multiple cores

2024-01-11 Thread 'qiulaidongfeng' via golang-nuts
I run gotip tool dist test -race I have noticed that many times when I run benchmark, CPU utilization is very low (about one core is used). I don't think github issue is the place to have that discussion. So come here and ask. I want someone to answer that Whether the gotip tool dist test -race

[go-nuts] Re: Rendering fonts in Go

2024-01-11 Thread 'Yuliana Zigangirova' via golang-nuts
Thank you, I will have a look. I have hoped on finding pure Go, but may be it is unrealistic. On Saturday, December 23, 2023 at 1:10:13 AM UTC+3 Howard C. Shaw III wrote: > I think Freetype may still be your best bet - but rather than the Freetype > port, you would need to use a wrapper that

[go-nuts] Re: TLS negotiation bug in go1.21.4?

2024-01-11 Thread Shifeng Song
hello, curious if you were able to resolve the issue by downgrading golang? im having the exact same issue as you causing TLS handshakes to fail On Thursday, January 11, 2024 at 8:06:16 AM UTC+8 Andrew Athan wrote: > I tried go1.21.6 and see the same behavior. I'm going to try to backport >

[go-nuts] Re: TLS negotiation bug in go1.21.4?

2024-01-11 Thread Stanley Song
hello, curious if you were able to resolve the issue by downgrading golang? I am having the exact same issue as you with cpu blowing up at crypto/internal/bigmod.(*Nat).montgomeryMul causing TLS handshakes to fail On Thursday, January 11, 2024 at 8:06:16 AM UTC+8 Andrew Athan wrote: > I tried

[go-nuts] Re: net.Listen -- How to listen to ipv6 & ipv4 local-loopback BUT NOT external interfaces

2024-01-11 Thread p...@morth.org
Hi, Unfortunately, the only way to avoid having two sockets in this scenario, is to listen to only one of 127.0.0.1 or ::1 and live with that it's only one address family. As you might've noticed, some tools still struggle with connecting to ::1 so listening to 127.0.0.1 is the most safe

Re: [go-nuts] Does building with an older golang use package sources from that older version?

2024-01-10 Thread 'Axel Wagner' via golang-nuts
You don't even need to run `go clean`. Go will automatically detect whether stuff needs to be rebuilt, as the Go version used to build a package is part of a hash, that is used as a key for the build cache. And yes, it will use the standard library packages of the Go version that is installed (the

[go-nuts] Does building with an older golang use package sources from that older version?

2024-01-10 Thread Andrew Athan
Say I install golang 1.20.12 and go clean -cache and go clean -modcache. Then I build. Will that executable be using crypto/tls and other packages "as they were in 1.20.12"? Or is golang fetching the newest available compatible sources, and therefore I may be spinning my wheels trying to see

[go-nuts] Re: TLS negotiation bug in go1.21.4?

2024-01-10 Thread Andrew Athan
I tried go1.21.6 and see the same behavior. I'm going to try to backport the project to go1.18 to see what happens. On Wednesday, January 10, 2024 at 3:51:16 PM UTC-8 Andrew Athan wrote: > As you can see in the below output from pprof, the golang TLS > implementation seems to be in some kind

[go-nuts] TLS negotiation bug in go1.21.4?

2024-01-10 Thread Andrew Athan
As you can see in the below output from pprof, the golang TLS implementation seems to be in some kind of tight loop in crypto/internal/bigmod.addMulVVW2048 causing CPU starvation, wherein the net.HTTP server stops calling my request handler. Eventually the TLS handshakes fail, and the

[go-nuts] net.Listen -- How to listen to ipv6 & ipv4 local-loopback BUT NOT external interfaces

2024-01-10 Thread Tony M
How do I listen on all* local / loopback* ipv4 /ipv6 interfaces? net.Listen('tcp', ':') listens on all interfaces. For my application (oauth token listener) I only want to listen to local / loopback go doc Net.listen: * if the host in the address parameter is empty or a literal

Re: [go-nuts] Re: Low memory utilization when using soft memory limit with GOGC=off

2024-01-10 Thread Zhihui Jiang
On Monday, January 8, 2024 at 7:24:27 AM UTC-8 Michael Knyszek wrote: On Sun, Jan 7, 2024 at 9:06 PM 'Zhihui Jiang' via golang-nuts < golan...@googlegroups.com> wrote: Hi Micheal, Sorry about delayed response! Please see my replies inline below. On Wednesday, December 6, 2023 at 8:22:34 PM

[go-nuts] Re: mmapping over Go heap

2024-01-10 Thread 'Brian Candler' via golang-nuts
> accessing it after munmap leads to SIGSEGV or worse There must be a hundred different ways you can make a Go program segfault, and this doesn't sound any worse that the rest of them. Besides, unless the GC is changed to handle mmap regions differently, I think you would have the problem the

[go-nuts] mmapping over Go heap

2024-01-10 Thread Nick Zavaritsky
Hi, Packages offering memory mapped files in golang follow one of the two possible routes: 1) memory is accessed via io.Reader (e.g. golang.org/x/exp/mmap); 2) mapped memory is directly exposed as []byte; accessing it after munmap leads to SIGSEGV or worse (e.g. github.com/edsrzf/mmap-go).

[go-nuts] Re: garbage collections on Windows and Mac

2024-01-09 Thread 'Michael Knyszek' via golang-nuts
On Tuesday, January 9, 2024 at 10:21:26 PM UTC-5 Michael Mitchell wrote: Hi, I have noticed on my macbook pro that HeapInUse is always slightly above NextGC when the garbage collection occurs. According to mstats.go, the "garbage collector's goal is to keep HeapAlloc less than NextGC" and

[go-nuts] garbage collections on Windows and Mac

2024-01-09 Thread Michael Mitchell
Hi, I have noticed on my macbook pro that HeapInUse is always slightly above NextGC when the garbage collection occurs. According to mstats.go, the "garbage collector's goal is to keep HeapAlloc less than NextGC" and also according to mstats.go, "HeapInUse minus HeapAlloc estimates the

[go-nuts] Cipher suite oddity

2024-01-09 Thread 'Brian Candler' via golang-nuts
Something just pointed out to me(*) that I don't understand: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA is in tls.CipherSuites() TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 is in tls.InsecureCipherSuites() Why is the SHA256 variant

Re: [go-nuts] Type parameter embedded field

2024-01-09 Thread 'Axel Wagner' via golang-nuts
I think that might work, yes. At least I don't see a major issue with it right now. On Tue, Jan 9, 2024 at 7:25 PM roger peppe wrote: > > > On Fri, 5 Jan 2024 at 05:58, 'Axel Wagner' via golang-nuts < > golang-nuts@googlegroups.com> wrote: > >> Hi, >> >> I think the reason this has not

[go-nuts] cgo: passing an array of char* to Go function

2024-01-09 Thread Patrick
Hello all, I have to admit that I am a C newbie. I want to use Go's slog mechanism with variable arguments (for example slog.Warn("message", "argument1", "value of argument1")) The Go function would be something like this: //export sdLogMessages func sdLogMessages(level *C.char, message

[go-nuts] Go 1.21.6 and Go 1.20.13 are released

2024-01-09 Thread announce
Hello gophers, We have just released Go versions 1.21.6 and 1.20.13, minor point releases. View the release notes for more information: https://go.dev/doc/devel/release#go1.21.6 You can download binary and source distributions from the Go website: https://go.dev/dl/ To compile from source

Re: [go-nuts] Type parameter embedded field

2024-01-09 Thread roger peppe
On Fri, 5 Jan 2024 at 05:58, 'Axel Wagner' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Hi, > > I think the reason this has not happened is that it makes code using such > a type invalid, depending on the type-argument - in ways not captured by > the constraint. For example: > > type

[go-nuts] Re: Blog Article: Go Generics (and also mocking)

2024-01-09 Thread 'TheDiveO' via golang-nuts
On Tuesday, January 9, 2024 at 2:28:08 AM UTC+1 Corin Lawson wrote: On Tuesday 9 January 2024 at 1:12:00 am UTC+11 TheDiveO wrote: One thing I notice is that your design assumes to specify the expected call sequence upon creation, or do I get this wrong? My expectation would be to specify this

Re: [go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-09 Thread John Jannotti
I wrote the single allocation version and added it to the issue, but Bakul is absolutely right that the recursive solution has merit when the input is large enough. By building up large values on each "side" of the recursion, Karatsuba gets used for the larger multiplies and the recursive version

Re: [go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-08 Thread Bakul Shah
For that you may wish to explore Peter Luschny's "prime swing" factorial algorithm and variations! https://oeis.org/A000142/a000142.pdf And implementations in various languages including go: https://github.com/PeterLuschny/Fast-Factorial-Functions > On Jan 8, 2024, at 9:22 PM, Rob Pike wrote:

Re: [go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-08 Thread Rob Pike
Here's an example where it's the bottleneck: ivy factorial !1e7 1.20242340052e+65657059 )cpu 1m10s (1m10s user, 167.330ms sys) -rob On Tue, Jan 9, 2024 at 2:21 PM Bakul Shah wrote: > Perhaps you were thinking of this? > > At iteration number k, the value xk contains O(klog(k)) digits,

Re: [go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-08 Thread Bakul Shah
Perhaps you were thinking of this? At iteration number k, the value xk contains O(klog(k)) digits, thus the computation of xk+1 = kxk has cost O(klog(k)). Finally, the total cost with this basic approach is O(2log(2)+¼+n log(n)) = O(n2log(n)). A better approach is the binary splitting : it just

[go-nuts] Re: Blog Article: Go Generics (and also mocking)

2024-01-08 Thread Corin Lawson
On Tuesday 9 January 2024 at 3:33:42 am UTC+11 Mike Schinkel wrote: It doesn't have to be imaginative nor obfuscated to be cognizant of naming conflicts. Thanks, you've convinced me that it needs to change so I'll do it now and I might steal that name (vermock)! On Tuesday 9 January 2024

Re: [go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-08 Thread Robert Griesemer
The overflow fix is pending: CL 554617 I filed https://github.com/golang/go/issues/65027 for a possibly faster mulRange implementation. - gri On Mon, Jan 8, 2024 at 11:47 AM Robert Griesemer wrote: > Hello John; > > Thanks for your interest in this code. > > In a (long past) implementation of

Re: [go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-08 Thread Robert Griesemer
Hello John; Thanks for your interest in this code. In a (long past) implementation of the factorial function, I noticed that computing a * (a+1) * (a+2) * ... (b-1) * b was much faster when computed in a recursive fashion than when computed iteratively: the reason (I believed) was that the

[go-nuts] Re: Creating a shared C library out of go project to be loaded dynamically by other applications (C/Perl/Python) on AIX 7.2

2024-01-08 Thread Anshuman Mor
Hi Miecc, Did you get this working, I am having exact same issues, wondering if you ever able to get this through? Or using gccgo? I am using gcc11 for this. On Thursday 24 March 2022 at 02:31:28 UTC+5:30 miecc kn wrote: > Hello everyone, first time here so please bear with me. > I got the

[go-nuts] Re: Blog Article: Go Generics (and also mocking)

2024-01-08 Thread Mike Schinkel
On Sunday, January 7, 2024 at 9:39:31 PM UTC-5 Corin Lawson wrote: *also thoughts on the mock lib (apologies for the lack of naming creativity),* On Monday, January 8, 2024 at 9:00:24 AM UTC-5 TheDiveO wrote: *As for the naming: kudos for naming it what it is, clear and concise* A

Re: [go-nuts] Incorrect "missing return" error for an edge case

2024-01-08 Thread burak serdar
Thank you both. I should've looked at the spec first. On Sun, Jan 7, 2024 at 10:34 PM 'Dan Kortschak' via golang-nuts wrote: > > On Mon, 2024-01-08 at 06:21 +0100, 'Axel Wagner' via golang-nuts wrote: > > The "missing return" error is defined in the spec, by requiring a > > function to end in a

[go-nuts] Re: Blog Article: Go Generics (and also mocking)

2024-01-08 Thread 'TheDiveO' via golang-nuts
a quick first lock looks promising to me: I like the blog post, as it does IMHO a gentle introduction to your angle of attack. Having used mocking (or one of its twins/cousins/... for those who insist on this not being mocking, alas) on Python I've up to now found the Go mock packages to be

[go-nuts] Re: CGO unpinned Go pointer panic

2024-01-08 Thread Tamás Gulácsi
That should work. Are you sure that those ellipses (...) does not contain some other pointers? Brent Bailey a következőt írta (2024. január 8., hétfő, 3:06:35 UTC+1): > I'm trying to pass a pointer to an external C library using Go 1.21 and > get the following runtime panic: > panic: runtime

Re: [go-nuts] Incorrect "missing return" error for an edge case

2024-01-07 Thread 'Dan Kortschak' via golang-nuts
On Mon, 2024-01-08 at 06:21 +0100, 'Axel Wagner' via golang-nuts wrote: > The "missing return" error is defined in the spec, by requiring a > function to end in a terminating statement: > https://go.dev/ref/spec#Terminating_statements > The list is necessarily not complete. So it is necessarily

Re: [go-nuts] Incorrect "missing return" error for an edge case

2024-01-07 Thread 'Axel Wagner' via golang-nuts
The "missing return" error is defined in the spec, by requiring a function to end in a terminating statement: https://go.dev/ref/spec#Terminating_statements The list is necessarily not complete. So it is necessarily more advisory than anything else. What things to put in is mainly limited by how

[go-nuts] Incorrect "missing return" error for an edge case

2024-01-07 Thread burak serdar
This question came up on Stack Overflow today: The following code is giving a "missing return" error where it shouldn't: func TestMethod() int { for i := 0; i < 10; i++ { return 0 } } Looks like an overlooked case in control flow analysis. -- You received this message because you

[go-nuts] Blog Article: Go Generics (and also mocking)

2024-01-07 Thread Corin Lawson
I recently published a blog post about Go generics. I've found that there's lots of very good technical information about generics in Go, but I felt that they are lacking some gritty experience reports. https://medium.com/versent-tech-blog/go-generics-tips-tricks-and-pitfalls-4342b82f9eeb The

Re: [go-nuts] Re: does anyone have an example of a Go kernel module

2024-01-07 Thread Robert Engels
Hasn’t been touched in 6 years and it doesn’t work. I guess they figured out it wasn’t worth the effort. The only plausible way to write a kernel module in Go is… don’t.Maybe run a user space Go process and some sort of shared memory communication. On Jan 7, 2024, at 8:06 PM, Hữu Hà wrote:Maybe

[go-nuts] Re: Low memory utilization when using soft memory limit with GOGC=off

2024-01-07 Thread 'Zhihui Jiang' via golang-nuts
Hi Micheal, Sorry about delayed response! Please see my replies inline below. On Wednesday, December 6, 2023 at 8:22:34 PM UTC-8 Michael Knyszek wrote: On Tuesday, December 5, 2023 at 1:06:19 AM UTC-5 Zhihui Jiang wrote: Hi there, We are running a large scale recommendation system using

[go-nuts] CGO unpinned Go pointer panic

2024-01-07 Thread Brent Bailey
I'm trying to pass a pointer to an external C library using Go 1.21 and get the following runtime panic: panic: runtime error: cgo argument has Go pointer to unpinned Go pointer My first attempt was: var bufferSize int = 0 C.external_library(...,(*C.size_t)(unsafe.Pointer())) I tried to pin the

[go-nuts] Re: does anyone have an example of a Go kernel module

2024-01-07 Thread Hữu Hà
Maybe you mean something like this ? https://github.com/gopher-os/gopher-os Vào lúc 04:22:10 UTC+7 ngày Chủ Nhật, 7 tháng 1, 2024, Siglo XIX đã viết: > I have tried many ways but now that the ecosystem is more mature maybe > someone knows of an example of how to make a Linux kernle module with

[go-nuts] cgo: Special case in unpinned go pointer checks

2024-01-07 Thread Antonio Caceres Cabrera
Dear golang nuts, I was trying to gain a better understanding of how cgo works internally, when I stumbled upon this implementation detail: https://github.com/golang/go/blob/8db131082d08e497fd8e9383d0ff7715e1bef478/src/runtime/cgocall.go#L628 ``` case kindStruct: st :=

Re: [go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-07 Thread John Jannotti
Actually, both implementations have bugs! The recursive implementation ends with: ``` m := (a + b) / 2 return z.mul(nat(nil).mulRange(a, m), nat(nil).mulRange(m+1, b)) ``` That's a bug whenever `(a+b)` overflows, making `m` small. FIX: `m := a + (b-a)/2` My iterative implementation went into an

Re: [go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-07 Thread John Jannotti
I'm equally curious. FWIW, I realized the loop should perhaps be ``` mb := nat(nil).setUint64(b) // ensure mb starts big enough for b, even on 32-bit arch for m := a + 1; m <= b; m++ { mb.setUint64(m) z = z.mul(z, mb) } ``` to avoid allocating repeatedly for `m`, which yields:

Re: [go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-06 Thread Rob Pike
It seems reasonable but first I'd like to understand why the recursive method is used. I can't deduce why, but the CL that adds it, by gri, does Karatsuba multiplication, which implies something deep is going on. I'll add him to the conversation. -rob On Sun, Jan 7, 2024 at 5:46 PM John

[go-nuts] Any interest in nat.mulRange simplification/optimization?

2024-01-06 Thread John Jannotti
I enjoy bignum implementations, so I was looking through nat.go and saw that `mulRange` is implemented in a surprising, recursive way,. In the non-base case, `mulRange(a, b)` returns `mulrange(a, (a+b)/2) * mulRange(1+(a+b)/2, b)` (lots of big.Int ceremony elided). That's fine, but I didn't

[go-nuts] does anyone have an example of a Go kernel module

2024-01-06 Thread Siglo XIX
I have tried many ways but now that the ecosystem is more mature maybe someone knows of an example of how to make a Linux kernle module with Go,. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

Re: [go-nuts] Type parameter embedded field

2024-01-06 Thread Mike Schinkel
On Saturday, January 6, 2024 at 7:58:55 AM UTC-5 Axel Wagner wrote: I took this idea into account in my original message. It is bullet point 2. The case against this is that it would likely make type-checking Go code (co-)NP-complete. If you watch my talk about methods in union elements

Re: [go-nuts] Re: [RFC] Syntactic Dissonance

2024-01-06 Thread John Pritchard
Hi, With [VAR] https://blog.merovius.de/posts/2018-06-03-why-doesnt-go-have-variance-in/ we review type diaspora into possibility space. Perhaps the assertion that the abstract operand is incapable of supporting the implications of its communication. Initially, [GST]

Re: [go-nuts] Re: [RFC] Syntactic Dissonance

2024-01-06 Thread 'Brian Candler' via golang-nuts
Full explanation here: https://blog.merovius.de/posts/2018-06-03-why-doesnt-go-have-variance-in/ On Saturday 6 January 2024 at 11:55:27 UTC John Pritchard wrote: > Hi, > > Thinking about types and their conception, I could avoid the type > assertion boilerplate and rationalize the type

Re: [go-nuts] Re: [RFC] Syntactic Dissonance

2024-01-06 Thread John Pritchard
Hi, Thinking about types and their conception, I could avoid the type assertion boilerplate and rationalize the type membership relationship if this code compiled. Best, John On Sat, Jan 6, 2024 at 3:21 AM Tamás Gulácsi wrote: > Where does TestObject implement the Comparable interface, esp.

Re: [go-nuts] Type parameter embedded field

2024-01-06 Thread Mike Schinkel
On Friday, January 5, 2024 at 9:12:13 AM UTC-5 Axel Wagner wrote: If the signature of a function says you are allowed to call the function, you should be allowed to call the function. While I'd argue we would be best to stick to objective arguments and not ones that affirm the consequent,

[go-nuts] Re: [RFC] Syntactic Dissonance

2024-01-06 Thread Tamás Gulácsi
Where does TestObject implement the Comparable interface, esp. the Compare method? I don't see such in that rep. The implemented TestObject.Compare method has different signature: it requests a TestObject, not a Comparable interface, as your spec! This is only the first error. The second is

[go-nuts] [RFC] Syntactic Dissonance

2024-01-05 Thread John Pritchard
Hi, Here's a case of "type dissonance" I don't understand. Why should it be? https://github.com/syntelos/go-sort An interface type not passing through a static public package function that employs the interface. type Comparable interface { Compare(Comparable) int } func Sort(array

Re: [go-nuts] Type parameter embedded field

2024-01-05 Thread Mike Schinkel
On Friday, January 5, 2024 at 12:59:25 AM UTC-5 Axel Wagner wrote: 3. Someone comes up with a clever new compromise. Here is a strawman proposal: Allow `Nullable`: type Nullable[T any] struct { T valid bool } By generating a compile error when a developer attempts to use a type as a

Re: [go-nuts] Type parameter embedded field

2024-01-04 Thread 'Axel Wagner' via golang-nuts
Hi, I think the reason this has not happened is that it makes code using such a type invalid, depending on the type-argument - in ways not captured by the constraint. For example: type X[T any] struct { T *bufio.Reader } func main() { var x X[int] x.Read // definitely refers to

[go-nuts] Type parameter embedded field

2024-01-04 Thread 'Sylvain Rabot' via golang-nuts
Hi, I am wondering if Type Parameter embedding is something that is likely to happen ? e.g.: type Nullable[T any] struct { T valid bool } Regards. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] Re: How to develop with Go source code change?

2024-01-04 Thread Jason Phillips
Note that just because there was a unit test failure doesn't mean the Go toolchain you built is not working. all.bash runs make.bash followed by run.bash. If I remember correctly, and if things haven't changed drastically since the last time I did it, the only required step for a usable

[go-nuts] Re: How to develop with Go source code change?

2024-01-04 Thread 'Rulin Tang' via golang-nuts
Thanks TheDiveO, I will double check. On Wednesday 3 January 2024 at 22:50:47 UTC+8 Rulin Tang wrote: > Try it again. And this time it works to build the new Go version. But the > debug message doesn't show. Not sure this is the expected result or not. > > On Wednesday 3 January 2024 at

[go-nuts] Re: <-ctx.Done() panic

2024-01-03 Thread cheng dong
yeah, i try race and found that we write/read ctx in race condition and solved it. thanks for give ideas On Wednesday, January 3, 2024 at 7:29:47 PM UTC+8 Brian Candler wrote: > Panics can be caused by all sorts of things, but concurrency issues are a > big one. Have you tried running your

[go-nuts] Re: How to develop with Go source code change?

2024-01-03 Thread 'Rulin Tang' via golang-nuts
Try it again. And this time it works to build the new Go version. But the debug message doesn't show. Not sure this is the expected result or not. On Wednesday 3 January 2024 at 00:45:12 UTC+8 Rulin Tang wrote: > Hey, I'm trying to do some Go source code development. But I'm confused > about

Re: [go-nuts] <-ctx.Done() panic

2024-01-03 Thread Johan Liebert
https://life2vecdeathcalculator.com/ On Wednesday, January 3, 2024 at 3:57:01 AM UTC-8 Sean Liao wrote: > maybe a bad custom context implementation in the chain > > - sean > > On Wed, Jan 3, 2024, 10:57 cheng dong wrote: > >> i have a program paniced with >> >> ``` >>

Re: [go-nuts] Re: A global panic handler for crash reporting

2024-01-03 Thread Johan Liebert
A global panic handler for crash reporting is a critical component in software development. It serves as a robust mechanism to capture, analyze, and respond to unexpected errors or crashes in applications. This handler acts as a safety net, allowing developers to receive real-time

Re: [go-nuts] <-ctx.Done() panic

2024-01-03 Thread 'Sean Liao' via golang-nuts
maybe a bad custom context implementation in the chain - sean On Wed, Jan 3, 2024, 10:57 cheng dong wrote: > i have a program paniced with > > ``` > runtime.deferCallSave(0xc0313d56d8, 0xc0401839e8?) > /home/ubuntu/go/go1.19.5/src/runtime/panic.go:796 +0x88 > fp=0xc0313d5618

[go-nuts] Re: Rendering fonts in Go

2024-01-03 Thread Egon
There's also https://github.com/go-text/typesetting and github.com/go-text/render. But, I'm not sure whether it covers your needs. On Saturday 23 December 2023 at 00:10:13 UTC+2 Howard C. Shaw III wrote: > I think Freetype may still be your best bet - but rather than the Freetype > port, you

[go-nuts] Re: <-ctx.Done() panic

2024-01-03 Thread 'Brian Candler' via golang-nuts
Panics can be caused by all sorts of things, but concurrency issues are a big one. Have you tried running your code under the race detector? https://go.dev/blog/race-detector On Wednesday 3 January 2024 at 10:57:49 UTC cheng dong wrote: > i have a program paniced with > > ``` >

[go-nuts] <-ctx.Done() panic

2024-01-03 Thread cheng dong
i have a program paniced with ``` runtime.deferCallSave(0xc0313d56d8, 0xc0401839e8?) /home/ubuntu/go/go1.19.5/src/runtime/panic.go:796 +0x88 fp=0xc0313d5618 sp=0xc0313d5608 pc=0x43b248 runtime.runOpenDeferFrame(0xc02349b860?, 0xc0300967d0)

[go-nuts] Re: How to develop with Go source code change?

2024-01-03 Thread 'TheDiveO' via golang-nuts
Maybe your output is interfering with the way the go code base does some of it's checks; based on the fail in cmd/vet maybe this could be involved: https://github.com/golang/go/blob/b25f5558c69140deb652337afaab5c1186cd0ff1/src/cmd/vet/vet_test.go#L197? On Tuesday, January 2, 2024 at 5:45:12 PM

Re: [go-nuts] Hello, world! - A technical overview of the software powering bgammon.org

2024-01-02 Thread Ian Davis
On Tue, 2 Jan 2024, at 2:39 AM, Trevor Slocum wrote: > I’ve just published a blog post about the software powering bgammon.org and > my experience creating it using free and open source tools: > > https://bgammon.org/blog/20240101-hello-world/ This was a great read, thank you. -- You received

[go-nuts] Assistance Needed with Go Compilation for PostgreSQL FDW on Linux

2024-01-02 Thread Binaek Sarkar
I am developing a version of the `steampipe-postgres-fdw` - a PostgreSQL Foreign Data Wrapper (FDW) written in Go. It is a part of the bigger `steampipe` project. While the project builds successfully on Darwin systems, I am encountering a specific challenge on Linux when integrating with

[go-nuts] How to develop with Go source code change?

2024-01-02 Thread 'Rulin Tang' via golang-nuts
Hey, I'm trying to do some Go source code development. But I'm confused about how to do the development. The Go source code is cloned from https://github.com/golang/go master branch. Originally, I run `cd src &^ ./all.bash` to build the latest Go 1.22 version. It works fine. Then I'm trying

[go-nuts] Hello, world! - A technical overview of the software powering bgammon.org

2024-01-01 Thread Trevor Slocum
I’ve just published a blog post about the software powering bgammon.org and my experience creating it using free and open source tools: https://bgammon.org/blog/20240101-hello-world/ -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Re: Maintaining a connection to Postgresql during database failover

2023-12-31 Thread Tamás Gulácsi
This is just from reading the docs: https://pkg.go.dev/github.com/jackc/pgx/v5@v5.5.1/pgconn#FallbackConfig is a member of https://pkg.go.dev/github.com/jackc/pgx/v5@v5.5.1/pgconn#Config and its comment seems to match your use case. I don;t know AWS RDS how does the failover (when is the

[go-nuts] Maintaining a connection to Postgresql during database failover

2023-12-31 Thread Dean Schulze
I have a web service in Gin that calls Postgresql running on AWS RDS with multi-az failover. When I reboot with failover the primary database and failover starts calls to the web service hang without even getting to the event handler. Once the failover is complete calls to the web service

Re: [go-nuts] How to create a generic factory?

2023-12-31 Thread 'Axel Wagner' via golang-nuts
Note that your code is not type-safe. It panics when instantiated with a type that does not use a pointer receiver: https://go.dev/play/p/eHUKtXvgwAu ISTM that being more type-safe would be an advantage here. On Sat, Dec 30, 2023 at 8:47 PM Mazen Harake wrote: > @Alex, > > Oh, and I should

Re: [go-nuts] How to create a generic factory?

2023-12-30 Thread Mazen Harake
@Alex, Oh, and I should point out that I actually went with what you mentioned in your 1st point, I was just curious if it was possible to do it the other way. On Saturday 30 December 2023 at 20:36:07 UTC+1 Mazen Harake wrote: > Cheers @Axel for the input. I think I worked it out though. >

Re: [go-nuts] How to create a generic factory?

2023-12-30 Thread Mazen Harake
Cheers @Axel for the input. I think I worked it out though. The bad thing is that it involves reflection but considering that it greatly simplifies the code base I would argue that it is good enough for now. First, regarding your 2nd point of passing buf as a parameter to Decode() instead of

Re: [go-nuts] How to create a generic factory?

2023-12-29 Thread 'Axel Wagner' via golang-nuts
1. Note that you can just write `NewMessage({}, buf)` in your example, as the type can be inferred. 2. You can use a constraint on a pointer-receiver to somewhat simplify that: https://go.dev/play/p/pEu02Bn9t3f That is not *quite* what you are asking for. It is not actually possible to really do

[go-nuts] How to create a generic factory?

2023-12-29 Thread Mazen Harake
Hi all, Assume I have a tcp server with incoming tcp packets which can be decoded in differently depending on some headers in that packet. Each message that comes in has a struct associated with it which can be created with the traditionale NewX..(buf []byte ...). After creating the object

Re: [go-nuts] https client 403 error

2023-12-29 Thread 'Sean Liao' via golang-nuts
see https://pkg.go.dev/net/http#Client.Jar - sean - sean On Fri, Dec 29, 2023 at 6:53 PM vlya...@gmail.com wrote: > > I use generic https client code to perform GET: > tr := { TLSClientConfig: {InsecureSkipVerify: > true}, } > client := { Transport: tr, } > req, err :=

[go-nuts] https client 403 error

2023-12-29 Thread vlya...@gmail.com
I use generic https client code to perform GET: tr := { TLSClientConfig: {InsecureSkipVerify: true }, } client := { Transport: tr, } req, err := http.NewRequest("GET", url, nil) ... resp, err := client.Do(req) for most urls it works fine but for some (https://www.indeed.com/ for

[go-nuts] Re: What is the idiomatic way to create dynamic clients for Firestore in Go

2023-12-29 Thread Darrel Herbst
Use https://pkg.go.dev/cloud.google.com/go/firestore#NewClientWithDatabase to specify the databaseID. On Wednesday, December 27, 2023 at 11:51:02 PM UTC-5 Alex Breadman wrote: > I want multi-tenancy but there is no clear documentation. > > Is it supported yet in the firebase/firestore packages

Re: [go-nuts] Re: How to get net.Conn in rpc function in net/rpc

2023-12-28 Thread 'Dan Kortschak' via golang-nuts
On Thu, 2023-12-28 at 13:14 -0800, 'Christian Stewart' via golang-nuts wrote: > I agree with what Brian said and would like to suggest the following > two way RPC library with multiplexing over a single connection of any > type: > > https://github.com/aperturerobotics/starpc > There is also

Re: [go-nuts] Re: How to get net.Conn in rpc function in net/rpc

2023-12-28 Thread 'Christian Stewart' via golang-nuts
I agree with what Brian said and would like to suggest the following two way RPC library with multiplexing over a single connection of any type: https://github.com/aperturerobotics/starpc On Thu, Dec 28, 2023, 10:06 AM 'Brian Candler' via golang-nuts < golang-nuts@googlegroups.com> wrote: >

[go-nuts] Re: How to get net.Conn in rpc function in net/rpc

2023-12-28 Thread 'Brian Candler' via golang-nuts
What do you mean by "Real IP" and in particular how does it differ from the TCP source address? If the client is behind a NAT, then (a) you won't know the client's real IP unless they tell it to you (and you trust what they say), and (b) you won't be able to connect to that address anyway. If

[go-nuts] How to get net.Conn in rpc function in net/rpc

2023-12-28 Thread York gao
I have a requirement that requires the rpc server to get the client’s **real IP** and current connection `net.Conn`. The reason for needing **real IP** and `net.Conn` is roughly for **two-way communication**. I hope to be able to send RPC requests to the client of a specific IP to perform

Re: [go-nuts] Need help running "go get" on self hosted git server

2023-12-28 Thread Brijesh Wawdhane
I was able to make it work (and no the server is healthy) I am using legit (https://github.com/icyphox/legit) for my git frontend, it is like cgit or stagit if you've those before. The default route for repo page in legit is domain.extension/repository.git, but because running legit is

[go-nuts] Re: Getting panic: proto: extension number 1042 is already registered on message google.protobuf.FileOptions

2023-12-27 Thread P.M. Roopan
I got the issue resolved, I was having 2 protobuf package. So I have uninstalled one and it worked fine. Thanks, Roopan On Wednesday 27 December 2023 at 09:35:25 UTC+5:30 Kevin Chowski wrote: > Please provide some more information about what you are trying to do, and > how to reproduce your

Re: [go-nuts] What is the idiomatic way to create dynamic clients for Firestore in Go

2023-12-27 Thread Kurtis Rader
Provide more context. What is "Firestore". This seems like a question better asked in the mailing list for that project. On Wed, Dec 27, 2023 at 8:51 PM Alex Breadman wrote: > I want multi-tenancy but there is no clear documentation. > > Is it supported yet in the firebase/firestore packages

[go-nuts] Re: What is the idiomatic way to create dynamic clients for Firestore in Go

2023-12-27 Thread Alex Breadman
There is no clear way to specify a database On Thursday, December 28, 2023 at 4:51:02 AM UTC Alex Breadman wrote: > I want multi-tenancy but there is no clear documentation. > > Is it supported yet in the firebase/firestore packages yet? > > Thanks > -- You received this message because you

[go-nuts] What is the idiomatic way to create dynamic clients for Firestore in Go

2023-12-27 Thread Alex Breadman
I want multi-tenancy but there is no clear documentation. Is it supported yet in the firebase/firestore packages yet? Thanks -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send

[go-nuts] Re: Getting panic: proto: extension number 1042 is already registered on message google.protobuf.FileOptions

2023-12-26 Thread Kevin Chowski
Please provide some more information about what you are trying to do, and how to reproduce your problem from scratch. Otherwise it will be hard to provide you any help at all. For example, what code are you using? What commands are you running? What goal are you trying to accomplish in the

Re: [go-nuts] Re: A global panic handler for crash reporting

2023-12-26 Thread Gergely Brautigam
Yah, that's true, I completely forgot about that. :/ I guess you could do what some others have done which is implement a Call function or a framework that runs all function calls in a middleware-esk style. And middleware has a recovery. So every call will have a recovery. On Tuesday 26

<    5   6   7   8   9   10   11   12   13   14   >