Re: [go-nuts] Unexpected circular type definition limitation

2023-06-15 Thread Jan Mercl
On Thu, Jun 15, 2023 at 10:16 AM christoph...@gmail.com wrote: > It is possible to define two structures globally with mutual type dependency > as this: > > type A struct { > B []B > } > > type B struct { > A A[] > } > > but I just noticed that we can't do that inside a function: > >

Re: [go-nuts] testing whether two maps are the same object

2023-07-18 Thread Jan Mercl
On Tue, Jul 18, 2023 at 4:35 PM Jochen Voss wrote: > Is there a better way? I have never been here and please don't do this: https://go.dev/play/p/x4QYJubXMnQ -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and

Re: [go-nuts] map type conversion

2023-07-16 Thread Jan Mercl
On Sun, Jul 16, 2023 at 6:02 PM Leonard Mittmann wrote: > Hi everyone, I am wondering if there is efficient way to do the following > type conversion (without looping over the map): > > var m = map[uint]uint{ /*...*/ } > type uintXXX uint > // this does not work > var m2 map[uintXXX]uintXXX =

Re: [go-nuts] Why not return after calling http.Error()

2023-07-04 Thread Jan Mercl
On Tue, Jul 4, 2023 at 5:38 PM Gurunandan Bhat wrote: > Every example of http Handler that I have seen so far looks like this: > > func handleSomeRequest(w http.ResponseWriter, r *http.Request) { > > // do something that returns an error > if err != nil { > http.Error(w,

Re: [go-nuts] Hosting to deploy && run exe ?

2023-06-11 Thread Jan Mercl
On Sun, Jun 11, 2023 at 7:40 PM alex-coder wrote: > Could you please advise me the simple hosting to deploy && run a small exe > assembled from go. I'm using https://www.hetzner.com/cloud?country=us and Google Cloud free tier. The later natively supports deployment of Go programs. -- You

Re: [go-nuts] Re: Error handling

2023-08-01 Thread Jan Mercl
On Tue, Aug 1, 2023 at 1:47 AM DrGo wrote: > The verbosity of error handling is the number one concern for Go developers > in the most recent survey. That says something about those developers, about their preferences, opinions, taste etc and that it differs from what the Original Language

Re: [go-nuts] no way to pause `Listen` on net connections

2023-07-24 Thread Jan Mercl
On Mon, Jul 24, 2023 at 9:14 AM David N wrote: On Linux you may try fiddling with iptables, limitations apply: https://stackoverflow.com/questions/44464617/stop-accepting-new-tcp-connections-without-dropping-any-existing-ones/44509993#44509993 -- You received this message because you are

Re: [go-nuts] no way to pause `Listen` on net connections

2023-07-24 Thread Jan Mercl
On Mon, Jul 24, 2023 at 9:26 AM David N wrote: > Yup, this makes sense and should work, but I'm still surprised this can't be > entirely done in Golang. Who says it's not possible? I'm not aware of a reason why the required parts cannot be implemented in pure Go (+ syscalls + right permission

Re: [go-nuts] [go test] pure Test Classes.

2023-07-26 Thread Jan Mercl
On Wed, Jul 26, 2023 at 9:44 AM sumith s wrote: > Currently, we do not have pure Test Classes defined by us. We are using > Golang specific Test Class structure. Each FILENAME_test.go will have its own > test class under "Golang Test". > I'm trying to define a pure Test Classes. how can do

Re: [go-nuts] go package dating back to 2009

2023-07-25 Thread Jan Mercl
On Wed, Jul 26, 2023 at 12:32 AM Bravo Moua wrote: > For a fact, bytes, fmt, and packages in those category are from Satoshi > Nakamoto and myself. Extraordinary claims require extraordinary evidence. -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Re: How to convert an svg to a png (or gif) image?

2023-08-04 Thread Jan Mercl
On Fri, Aug 4, 2023 at 1:22 PM Brian Candler wrote: > Also there's a project which compiles C code to Go - ISTR it was used to > build a pure Go version of Sqlite. Presumably the same approach could be > applied to an image processing library. > >

[go-nuts] Re: Go 1.21.0 is released

2023-08-08 Thread Jan Mercl
On Tue, Aug 8, 2023 at 5:24 PM wrote: > We have just released Go 1.21.0. > > To find out what has changed in Go 1.21, read the release notes: > https://go.dev/doc/go1.21 > > You can download binary and source distributions from our download page: > https://go.dev/dl/#go1.21.0 It looks like the

Re: [go-nuts] Re: Go 1.21.0 is released

2023-08-09 Thread Jan Mercl
On Wed, Aug 9, 2023, 09:12 Marcello H wrote: > https://go.dev/dl/go1.21.0.windows-arm64.zip > > It is found when you click on "Other Ports" Thanks. I may have a false memory of always finding the windows/arm64 port beside the windows/amd64 one in the same section. -j -- You received this

Re: [go-nuts] Re: Using go run with #!

2023-06-21 Thread Jan Mercl
On Wed, Jun 21, 2023 at 8:33 PM Dzmitry Lahoda wrote: > > rust just got shebang and cargo in one file. i was hoping using go as good > fit for some cases. but seem it will be rust. we are go, bash, nix, rust > coders. sure there is some js in our repo. but i hate it. i like to so script >

Re: [go-nuts] Why is reflect.CanAddr() returning false in this case ?

2023-06-22 Thread Jan Mercl
On Thu, Jun 22, 2023 at 12:16 PM christoph...@gmail.com wrote: > > I'm trying to get the uintptr address of a value p for which I have the > reflect.Value so that I can compare it with the value obtained with > v.Pointer() when p is a pointer. > > Here is a simple recursive pointer example code

Re: [go-nuts] Please consider voting to reopen Golang subreddit

2023-06-23 Thread Jan Mercl
On Fri, Jun 23, 2023 at 7:01 AM 'Axel Wagner' via golang-nuts < golang-nuts@googlegroups.com> wrote: > And even *when* they ask and get overwhelming backing from their communities, ... Latest poll results on r/golang as of now: [image: image.png]

Re: [go-nuts] Please consider voting to reopen Golang subreddit

2023-06-23 Thread Jan Mercl
On Fri, Jun 23, 2023 at 10:18 AM Axel Wagner wrote: > Just for context, as not everyone seems to be aware: I was, in that sentence > you quoted, referring to examples like this > https://www.reddit.com/r/ModCoord/comments/14eq8ip/the_entire_rmildlyinteresting_mod_team_has_just/ > This

Re: [go-nuts] delve crashes in presence of a circular reference variable

2023-06-23 Thread Jan Mercl
On Fri, Jun 23, 2023 at 10:38 AM christoph...@gmail.com wrote: > > Here is the minimal example code causing delve 1.20.2 to crash with a stack > overflow > > func TestExample(t *testing.T) { > type pptr *pptr > var p pptr > p = > t.Error("hello") > } > > Here is the stack trace

Re: [go-nuts] Re: HTTP client timeout

2023-05-05 Thread Jan Mercl
On Fri, May 5, 2023 at 4:21 PM envee wrote: > > Thanks Jan. > My interface speed is 20 Gb/s > The payload size is about 2.8Kb. > So at 9000 Txn/s this works out to 9000 x 3 ≅27MB/s ≅ 200 Mb/s (This matches > the so (socket out) value shown in my atop command output) > I guess the interface speed

Re: [go-nuts] Re: HTTP client timeout

2023-05-05 Thread Jan Mercl
On Fri, May 5, 2023 at 2:45 PM envee wrote: > Still, I don't understand why I cannot achieve higher throughput than 9000 > per second. What is the max bitrate of the network interface used in the measurement and what is the size of the payload that has to get through for every connection? --

Re: [go-nuts] big int panic on text conversion

2024-02-14 Thread Jan Mercl
On Wed, Feb 14, 2024 at 12:14 PM 'Dan Kortschak' via golang-nuts wrote: > Given that this can happen without a race or unsafe modifications it > might be worth filing a issue for. I think this is expected. Quoting from the big.Int docs https://pkg.go.dev/math/big#Int To "copy" an Int

Re: [go-nuts] Ghost/indirect dependency on a custom package

2024-02-20 Thread Jan Mercl
On Tue, Feb 20, 2024 at 11:07 AM Peter Bočan wrote: > Is there a way to debug this? Is there a way to step over the initialisation > order? I try to get help from '$ go mod graph' in similar investigations. -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Unhappy with the official generics tutorial

2024-02-22 Thread Jan Mercl
On Thu, Feb 22, 2024 at 10:06 AM 'Carla Pfaff' via golang-nuts wrote: > This omission is notable considering "any" is among the most frequently used > constraints in writing generic code. Interesting to know, I'd naively guess the opposite. Can you please share the source data set? Thank you.

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

2023-12-18 Thread Jan Mercl
On Mon, Dec 18, 2023 at 2:19 PM Brijesh Wawdhane wrote: > I added a go-import meta tag to my git server's website on the repo page and it looks like > > https://brijesh.dev/kairos.git;> > > but when I try running "go get brijesh.dev/kairos" I get an error saying 'go: unrecognized import path

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

2023-12-26 Thread Jan Mercl
On Tue, Dec 26, 2023 at 9:12 AM Gergely Brautigam wrote: > If you have a top level recover in you main, it doesn't matter where the > panic happens, you'll capture it. Even in third party library. Iff the panic occurs in the same goroutine where the defer is. Every go statement starts a new

Re: [go-nuts] circular package dependency between golang.org/x/mod and golang.org/x/tools

2023-12-19 Thread Jan Mercl
On Tue, Dec 19, 2023 at 9:37 PM Nathan Lacey wrote: > I noticed that we have a circular dependency between golang.org/x/mod and > golang.org/x/tools > > golang.org/x/mod zip/zip_test.go includes golang.org/x/tools > I think we could get rid of the circular package dependency by changing that

Re: [go-nuts] detecting deleted file that is still open and appending without error in Go?

2023-12-10 Thread Jan Mercl
On Sun, Dec 10, 2023 at 8:34 PM Jason E. Aten wrote: > I noticed that the binary log was not growing, and its update timestamp was > not changing. I think the file was still growing as intended. It was only no more associated with the _new_ entry/name in the directory. I'm pointing it out

Re: [go-nuts] detecting deleted file that is still open and appending without error in Go?

2023-12-10 Thread Jan Mercl
On Sun, Dec 10, 2023 at 5:41 PM Jason E. Aten wrote: > My question is: is there a way to have the Go process detect if the file it > is writing to has been deleted by another process (git in this case) so that > attempting to append to the file is no longer effective? It is effective and

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

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): >

Re: [go-nuts] Go ARM

2023-11-15 Thread Jan Mercl
On Wed, Nov 15, 2023 at 9:59 PM Stephen Illingworth wrote: > > That works better although not perfectly for my purposes. More work required > from me. > > I'm curious though, about the -marm flag. How can I remove it from the > GOGCCFLAGS variable? Or are we saying we can't use the aarch64

Re: [go-nuts] Go ARM

2023-11-15 Thread Jan Mercl
On Wed, Nov 15, 2023 at 8:30 PM Stephen Illingworth < stephen.illingwo...@gmail.com> wrote: > I'm trying to build a project on the Raspberry Pi, natively. > > Using "go env" I can see that Go has the following value for GOGCCFLAGS > > GOGCCFLAGS='-fPIC -marm -Wl,--no-gc-sections -fmessage-length=0

Re: [go-nuts] Equality of interface of an empty struct - why?

2024-02-26 Thread Jan Mercl
On Tue, Feb 27, 2024 at 6:20 AM tapi...@gmail.com wrote: > From common sense, this is an obvious bug. But the spec is indeed not clear > enough. > It doesn't state whether or not comparisons of pointers to two distinct > zero-size variables should be consistent in a run session. > Though, from

Re: [go-nuts] Enums, Go1 and proposals

2024-03-04 Thread Jan Mercl
On Mon, Mar 4, 2024 at 6:19 PM Jeremy French wrote: > More, to prevent PrintMonth(14), which the function would have to check for > and either return an error or panic, since there is no meaningful output. In > fact, it's fairly easy to see, even in this case, where the PrintMonth >

Re: [go-nuts] Enums, Go1 and proposals

2024-03-04 Thread Jan Mercl
On Mon, Mar 4, 2024 at 4:19 PM Jeremy French wrote: > It's checked at compile-time rather than run time. That requires immutability of variables of enum type. Go does not support immutable variables. -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Nillable basic types?

2024-03-18 Thread Jan Mercl
On Mon, Mar 18, 2024 at 4:41 AM Daniel Lepage wrote: > This change would be entirely backward-compatible ... Let's consider, for example, the type uint8, aka byte. A variable of type byte is specified* to occupy 8 bits of memory and has 256 possible values. To represent all those values and the

Re: [go-nuts] GO111MODULE=off go get deprecated?

2024-03-07 Thread Jan Mercl
On Sun, Mar 3, 2024 at 10:25 PM Jeffery Carr wrote: > Has this been deprecated or maybe it is broken in debian sid, but: > > bash$ GO111MODULE=off go get -v go.wit.com/apps/test > go: modules disabled by GO111MODULE=off; see 'go help modules' > basj$ go version > go version go1.22.0 linux/amd64

Re: [go-nuts] Is golang.org/x/text/message's Printer thread safe?

2024-04-22 Thread Jan Mercl
On Mon, Apr 22, 2024 at 11:23 AM Xiangrong Fang wrote: > Is golang.org/x/text/message's *message.Printer safe to use in goroutines? I don't know, but usually things are safe for concurrent use by multiple goroutines only when explicitly documented as such. -- You received this message because

<    7   8   9   10   11   12