Re: [go-nuts] Re: go:embed question

2022-10-16 Thread jake...@gmail.com
What makes you think that go run github.com/esimov/caire/cmd/caire@latest is not embedding properly? On my system it seems like it works fine, and the file gets embedded. I'm using go 1.19 on windows. Perhaps you could give a more detailed example of what you are doing (actual commands) and wha

[go-nuts] Re: Atomic pointers to arrays and sequenced-before guarantees for array elements

2022-10-30 Thread jake...@gmail.com
I would like to give you a definitive answer, but the same question comes up in https://groups.google.com/g/golang-nuts/c/Gze1TRtdLdc/ and there is much disagreement and no clear resolution. (The initial question is not exactly yours, but if I understand correctly, the discussion quickly gets s

Re: [go-nuts] How does the go compiler treat initialized string variables?

2022-11-02 Thread jake...@gmail.com
Just to add a tidbit to what Jan said. The key here is that strings (type string) in Go are immutable, whereas strings ("char *" based types) in C are not. That is why the same string can be used again and again without ever needing to be copied, and why they can live in the text segment. On T

[go-nuts] Re: marshalling array of bson.M

2023-01-15 Thread jake...@gmail.com
You will probably get more help if you provide the relevant details, such as which bson package you are using. And provide an *example *that shows what you have tried that produces the error. A playground link using the "share" button is the preferred way to include examp

[go-nuts] Re: dont know how to use library in go

2023-01-21 Thread jake...@gmail.com
It sounds to me like you are trying to write linux code to load a .so file. Not something I have done in a while, but since no one else has offered any help, I will give you a few pointers. I believe that syscall.LoadDLL is for Windows only, so that code *will not work* at all in linux. You

Re: [go-nuts] Creating and Linking to Shared Library Version of Go Runtime?

2023-01-29 Thread jake...@gmail.com
This is pretty OT, and I am no expert, but the overwhelming consensus on the inter-tubes seems to be that *reading *from an SSD causes no 'wear' whatsoever. It is only writes and deletes that age an SSD. So this use case should not impact SSD life. But it is an interesting endeavor on its own.

[go-nuts] Re: Re-entrant locks?

2023-02-07 Thread jake...@gmail.com
Or maybe its because, if the language included them, then people would use them. And that is (almost?) always a bad idea. Not providing a tool that usually leads to code that is hard to maintain, and often incorrect or poorly designed seems to be in line with Go's overall vision. One of the rea

[go-nuts] Re: memory issues

2023-02-09 Thread jake...@gmail.com
What Marcello said! But also, the message mentions bad use of Unsafe.Pointer. You might want to look at uses in your app, and even third party libraries. See the documentation: https://pkg.go.dev/unsafe#Pointer - The rules must be followed to the letter! Are you using cgo? It also has very s

[go-nuts] Re: catching an internal/poll error?

2023-02-19 Thread jake...@gmail.com
You might want to dig a bit more. The error that generated that string would not be an ErrFileClosing. It appears that it originated with an ErrFileClosing, but by the time it gets to you it has been wrapped more than once as it percolated up the layers of code. On Sunday, February 19, 2023 at

[go-nuts] Re: Ask about Golang Behavior

2023-03-20 Thread jake...@gmail.com
You have: fmt.Println("AFTER:", newMessage.Biawaks == nil, cap(message.Biawaks)) Did you mean: fmt.Println("AFTER:", newMessage.Biawaks == nil, cap( newMessage.Biawaks)) If so, then On Monday, March 20, 2023 at 11:44:54 AM UTC-4 febriananda pramudita wrote: > I was playing with protobuf marshal

[go-nuts] Re: Pointer constraint to generics

2023-04-15 Thread jake...@gmail.com
What About: func PointerOrError[T *Q, Q any](s C.StatusOr ) (t T, err error) Seems to compile: https://go.dev/play/p/n4I-XkONj-O?v=gotip On Saturday, April 15, 2023 at 6:28:39 AM UTC-4 Jan wrote: > hi, > > This is a variation for a previous topic >

[go-nuts] Re: 'go run hello.go' taking ~30 seconds on windows

2023-06-23 Thread jake...@gmail.com
This may be related. I have always had a significant delay when building Go programs on Windows. It mostly happens the first time I build, if I have not built recently. A normal build of a simple program is about 3 seconds of wall clock time, whereas it can take over 20 seconds when it is being

[go-nuts] Re: Where are closure storing the captured variables ?

2023-07-06 Thread jake...@gmail.com
In addition to Axel's useful info, whenever you are interested in what escapes to the 'heap', it can be helpful to build with escape analyses output. Try using "go build -gcflags=-m". On Wednesday, July 5, 2023 at 8:35:52 PM UTC-4 chris...@meessen.net wrote: > Hello, > > Closure need space t

[go-nuts] Re: slog's use of runtime.Callers() with a skip

2023-08-11 Thread jake...@gmail.com
As far as I can tell, skip works even in the face of inlined functions, at least when used with runtime.CallersFrames(). It would be surprising to me if it did not. Do you have any evidence to the contrary? On Friday, August 4, 2023 at 9:51:34 AM UTC-4 sh...@tigera.io wrote: > I was looking at

[go-nuts] Re: GO language best practice document

2023-09-13 Thread jake...@gmail.com
In addition to the style guide, I have found https://github.com/golang/go/wiki/CodeReviewComments to have some interesting insights. On Friday, September 8, 2023 at 9:05:12 AM UTC-4 Alexandre Roy wrote: > Hi, > > I want to start a new web application using GO with AWS Lambda, but first > I wan

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

2024-02-24 Thread jake...@gmail.com
What is really fantastical is that a==b prints false, even though the pointers are actually the same. I am guessing some sort of optimization effect is at play here. https://go.dev/play/p/Dsqeh_aAXKT type Foo struct { } func main() { a := &Foo{} b := &Foo{} fmt.Printf("%t\n", *a == *b) fmt.P

[go-nuts] Re: How to have panic messages show in a PowerShell console

2024-03-01 Thread jake...@gmail.com
FWIW, in a very simple test on Windows 10 in a powershell console, running a go executable built with go1.19 prints the panic just like in a regular cmd console. On Wednesday, February 28, 2024 at 3:20:55 PM UTC-5 Thom BENTLEY wrote: > Hi All, > > OS: Windows 10 > GoLang: go1.6.3 windows/386

[go-nuts] Re: Profiling the `go` tool itself?

2024-10-25 Thread jake...@gmail.com
May be related to this gonuts post . As of go 1.19 I (and others) get slow builds on Windows, apparently because of excessive file reads on every build. I was getting 2,000 standard library files read, in their entirety, to b

<    1   2