Re: [go-nuts] Imitating tuple in golang

2024-08-08 Thread Gergely Brautigam
My apologies the link is incorrect. It should be https://github.com/Skarlso/tuple Hopefully it’s somewhat of a help in pursuing this topic. On Friday 9 August 2024 at 07:57:33 UTC+2 Gergely Brautigam wrote: > Hello. > > I actually implemented a Tupke logic here https://github.co

Re: [go-nuts] Imitating tuple in golang

2024-08-08 Thread Gergely Brautigam
My apologies for the link. Google groups on mobile isn’t really working. https://girhub.com/Skarlso/tuple On Friday 9 August 2024 at 07:57:33 UTC+2 Gergely Brautigam wrote: > Hello. > > I actually implemented a Tupke logic here https://github.con/Skarlso/tuple > . > > I find

Re: [go-nuts] Imitating tuple in golang

2024-08-08 Thread Gergely Brautigam
Hello. I actually implemented a Tupke logic here https://github.con/Skarlso/tuple. I find this a much better way to deal with tuples instead of the indexing logic. And it’s using generics as well. Feel free to borrow stuff. 😊 On Friday 9 August 2024 at 02:19:22 UTC+2 Jolyon Direnko-Smith wrote

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

2023-12-26 Thread Gergely Brautigam
ay 26 December 2023 at 10:15:12 UTC+1 Jan Mercl wrote: > 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

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

2023-12-26 Thread Gergely Brautigam
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. package main import ( "fmt" "github.com/Skarlso/panic" ) func main() { defer func() { if r := recover(); r != nil { fmt.Println("Recovered in f", r) } }() fmt

Re: [go-nuts] What's the consensus these days on dealing with defer errors?

2022-10-27 Thread Gergely Brautigam
> On 2022. Oct 27., at 20:16, Konstantin Khomoutov wrote: > > On Thu, Oct 27, 2022 at 11:01:01AM -0700, Gergely Brautigam wrote: > > [...] >>> Since Go 1.13 you can also make chains of errors; say, in your second >>> example >>> you could do >

Re: [go-nuts] What's the consensus these days on dealing with defer errors?

2022-10-27 Thread Gergely Brautigam
2022 at 06:23:31AM -0700, Gergely Brautigam wrote: > > > I was wondering what's the consensus these days on handling defer > errors? > > > > Is it something like, overwriting the returned value, or using a list of > > errors? > > > > Eith

[go-nuts] What's the consensus these days on dealing with defer errors?

2022-10-27 Thread Gergely Brautigam
Hello, esteemed Gophers. I was wondering what's the consensus these days on handling defer errors? Is it something like, overwriting the returned value, or using a list of errors? Either: func test() (err error) { defer func() { if tmpErr := doSomething(); tmpErr != nil {

Re: [go-nuts] Having trouble in running a go-git api example

2022-10-18 Thread Gergely Brautigam
Do you know how git works? You need a remote url for the repository to push to. > On 2022. Oct 18., at 12:45, PK wrote: > > Thank you, I tried to setup by this: > > if err_psh = repo.Push(&git.PushOptions{ > >RemoteName: "origin", > >}); err != nil { > >log.Fatal(err_psh)

Re: [go-nuts] Having trouble in running a go-git api example

2022-10-18 Thread Gergely Brautigam
> On 2022. Oct 18., at 11:19, PK wrote: > > no, Do we need to set-up something. If yes can you please let me know? Yep. Well, you are trying to push something to somewhere, right? So you need a remote set up which is usually origin. So just set up a remote and then you can push. Of course if

[go-nuts] Re: Having trouble in running a go-git api example

2022-10-17 Thread Gergely Brautigam
Hello. Did you set up any remotes for the folder that you are trying to push? On Monday, 17 October 2022 at 13:16:12 UTC+2 princ...@gmail.com wrote: > Hi, > I am trying to run example provided here( > https://github.com/go-git/go-git/tree/master/_examples) > > 1) firstly I run the clone example

Re: [go-nuts] Re: How can I break out of a goroutine if a condition is met?

2021-07-21 Thread Gergely Brautigam
On Wednesday, 21 July 2021 at 10:05:10 UTC+2 Brian Candler wrote: > Channels are almost always better than low-level primitives like condition > variables, which have various pitfalls. Almost always. :) Sure, there are alternatives, but sync.Cond makes sense once you use it properly. And it

Re: [go-nuts] Re: How can I break out of a goroutine if a condition is met?

2021-07-20 Thread Gergely Brautigam
I think this is a perfect scenario for sync.Cond https://pkg.go.dev/sync#Cond. On Tuesday, 20 July 2021 at 21:21:27 UTC+2 prawira.d...@gmail.com wrote: > I personally like to use range channel to "break out" process in > goroutine, for example : > > package main > import ( > "fmt" > "sy

[go-nuts] Re: Go 1.9 Release Candidate 1 is released

2017-07-26 Thread Gergely Brautigam
Yaay! Awesome! On Tuesday, 25 July 2017 18:30:06 UTC+2, Chris Broadfoot wrote: > > Hello gophers, > > We have just released go1.9rc1, a release candidate of Go 1.9. > It is cut from release-branch.go1.9 at the revision tagged go1.9rc1. > > Thank you to everyone who has helped to test Go 1.9 so