[go-nuts] Re: a way to access the full information that contains datas from database in golang

2022-08-08 Thread Marcello H
I saw an old discussion about this (and it might have a solution too) https://github.com/golang/go/issues/16652 Op maandag 8 augustus 2022 om 17:12:11 UTC+2 schreef mandel...@gmail.com: > There should be a way to access the full information a driver has for > result columns. > -- You received

Re: [go-nuts] Preemptive interfaces in Go

2022-08-08 Thread Henry
I am sure that many of us have been on that journey. After using Go for some time, we discover some practices that are not necessarily in agreement with the existing "adages" but effectively solve our problems. For me, if the data type is mutable, I prefer returning interfaces. It would be so

Re: [go-nuts] Do I need a reentrant locks?

2022-08-08 Thread atd...@gmail.com
So it seems that reentrant locks are a hard requirement after all. The reason being that an event handler can itself trigger an event which will be handled by a similar callback synchronously. (basically, callback composition) If the first event handler locks the UI tree, the next synchronous cal

Re: [go-nuts] Re: Triggering go:generate via go build/install?

2022-08-08 Thread Ian Lance Taylor
On Mon, Aug 8, 2022 at 4:51 AM Volker Dobler wrote: > > Executing code during build is a 100% no-go from a security perspective. > Especially arbitrary 3rd party code. > > So let me rephrase it: > > > One of the big advantages of Go's build systems is that running > > generators is **not** automat

Re: [go-nuts] Preemptive interfaces in Go

2022-08-08 Thread Tim Peoples
I can't speak to the *auto-generated swagger client* case but I believe gRPC is still doing things the right way -- in that the framework defines an interface I (the framework API consumer) then implements. IOW: I don't see that as a "java style interface" (where the interface defines the API

Re: [go-nuts] Preemptive interfaces in Go

2022-08-08 Thread burak serdar
On Mon, Aug 8, 2022 at 12:51 PM Tim Peoples wrote: > I don't necessarily consider the "multiple implementations" case as being > truly preemptive -- if there really are multiple implementations (e.g. the > "hash" package from the standard library). > > I'm much more concerned about interfaces tha

Re: [go-nuts] Preemptive interfaces in Go

2022-08-08 Thread Tim Peoples
I don't necessarily consider the "multiple implementations" case as being truly preemptive -- if there really are multiple implementations (e.g. the "hash" package from the standard library). I'm much more concerned about interfaces that are defined by an API producer -- for one and only one im

Re: [go-nuts] Preemptive interfaces in Go

2022-08-08 Thread burak serdar
On Mon, Aug 8, 2022 at 11:17 AM Tim Peoples wrote: > > For years I've read the old adage, "Accept interfaces, return structs" and > have spent years working to instill this understanding among my colleagues. > I gathered a great many skills while learning Go (and acquiring > readability) back in

[go-nuts] Preemptive interfaces in Go

2022-08-08 Thread Tim Peoples
For years I've read the old adage, "Accept interfaces, return structs" and have spent years working to instill this understanding among my colleagues. I gathered a great many skills while learning Go (and acquiring readability) back in the day -- and one of the strongest of those is the idea

[go-nuts] a way to access the full information that contains datas from database in golang

2022-08-08 Thread 白旭冉
There should be a way to access the full information a driver has for result columns. -- 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 an email to golang-nuts+unsubscr...@goo

[go-nuts] Re: Triggering go:generate via go build/install?

2022-08-08 Thread Volker Dobler
Executing code during build is a 100% no-go from a security perspective. Especially arbitrary 3rd party code. So let me rephrase it: > One of the big advantages of Go's build systems is that running > generators is **not** automated. V On Monday, 8 August 2022 at 12:34:43 UTC+2 stalke...@proton

[go-nuts] Triggering go:generate via go build/install?

2022-08-08 Thread 'David Vennik' via golang-nuts
One of the big advantages of many other build systems and for which reason many Go projects use Makefiles is that running generators is not automated. As I see it, the only thing required to make it automatic is annotation to make note of the sources that generators build off and trigger rerunni

Re: [go-nuts] Re: gouse — toggle ‘declared but not used’ errors

2022-08-08 Thread Jan Mercl
Put `func use(...interface{}) {}` into any *_test.go file. Call it with any variable(s) that is/are temporarily unused during testing/debugging. It work also for unused imports by naming something from the package. The code does not compile outside of `$ go test`, it's not possible to forget and

[go-nuts] Re: gouse — toggle ‘declared but not used’ errors

2022-08-08 Thread Tamás Gulácsi
This is horrible. The 'declared but not used' error saved me hundreds of times, and for experimenting, adding a "_ = notUsed" or hide the whole part behind an "if false" is not a burden. george...@gmail.com a következőt írta (2022. augusztus 6., szombat, 16:26:33 UTC+2): > Hi everyone! > > I