[go-nuts] Issue with go-git API

2022-10-09 Thread PK
I am trying to use this git api(*https://github.com/go-git/go-git*), but before that I tried to run the provided example (i.e. cloning the repo by golang). So I run the program *https://github.com/go-git/go-git/blob/master/_examples/clone/main.go* So when I run this program I used to get this

Re: [go-nuts] Practical use cases of recover in golang

2022-10-09 Thread Henry
You may want to make your app more robust by handling panic in the topmost layer of your application. With many people working on the code and various external dependencies, it is often impractical to ensure none of the code panics. This is where recover comes in. On Monday, October 10, 2022

[go-nuts] Re: What is the relationship between go community and goproxy.io

2022-10-09 Thread tapi...@gmail.com
On Sunday, October 9, 2022 at 11:50:49 PM UTC+8 ljh wrote: > Hi, community, > > I Just saw this site: yunzhanghu.com , is listed as Special Sponsor on > goproxy.io homepage. > > I'm just curious, is goproxy.io endorsed by The Go Team and is goproxy.io > trustworthy? > By the go module cache

Re: [go-nuts] Practical use cases of recover in golang

2022-10-09 Thread Kurtis Rader
The Elvish shell uses panic capture to ensure an interactive Elvish shell that paniced is replaced by a recovery shell. While still outputting important information about the panic. See this code

[go-nuts] Re: Practical use cases of recover in golang

2022-10-09 Thread Eswaran S.K.
Production Code is typically written with multiple layers of abstraction. Typical patterns involve generic ones like Proxy / Command patterns. In these types of pattern, execution context is provided by the Client/Invoker. But, the implementation for execution is done by the different

Re: [go-nuts] Practical use cases of recover in golang

2022-10-09 Thread Ian Lance Taylor
On Sun, Oct 9, 2022 at 2:17 PM cg-guy wrote: > > Whatever I have been worked so far with golang,I did not use recover() > function . > Curious to know if anyone using recover in production code and can you please > the scenarios where it is used. You may want to look at how it is used in the Go

[go-nuts] Practical use cases of recover in golang

2022-10-09 Thread cg-guy
Hi Team, Whatever I have been worked so far with golang,I did not use recover() function . Curious to know if anyone using recover in production code and can you please the scenarios where it is used. Thanks -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Go generics: type constraint for function or (non-type constraint) interface?

2022-10-09 Thread TheDiveO
Thank you! I was already expecting a twin no, but wanted to ensure that I didn't had overlooked something. On Wednesday, September 28, 2022 at 9:12:16 PM UTC+2 axel.wa...@googlemail.com wrote: > No and no. > > On Wed, Sep 28, 2022 at 9:05 PM TheDiveO wrote: > >> Is there currently a way in Go

Re: [go-nuts] What is the relationship between go community and goproxy.io

2022-10-09 Thread Ian Lance Taylor
On Sun, Oct 9, 2022 at 10:59 AM ljh wrote: > > There is no official proxy / mirror sites by core team, right? The Go team runs proxy.golang.org. See https://go.dev/blog/module-mirror-launch . The "go" command uses that proxy by default, though you can change that; see

Re: [go-nuts] Structures / mutex question

2022-10-09 Thread burak serdar
On Sun, Oct 9, 2022 at 12:44 PM Slawomir Pryczek wrote: > Thanks, very good point about including the structure by-value. > > As for using the structure via pointer > > > You don't need to rlock the global mutex. Even if another goroutine > appends to > > the slice and slice gets reallocated,

Re: [go-nuts] Structures / mutex question

2022-10-09 Thread Slawomir Pryczek
Thanks, very good point about including the structure by-value. As for using the structure via pointer > You don't need to rlock the global mutex. Even if another goroutine appends to > the slice and slice gets reallocated, this code will still be pointing to the correct element. I'd assume

回复: [go-nuts] What is the relationship between go community and goproxy.io

2022-10-09 Thread 'ljh' via golang-nuts
Thanks Ian, There is no official proxy / mirror sites by core team, right? -- 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

Re: [go-nuts] Structures / mutex question

2022-10-09 Thread burak serdar
On Sun, Oct 9, 2022 at 5:49 AM Slawomir Pryczek wrote: > Hi Guys, > wanted to see if i making correct assumptions regarding mutexes and > structures > > var globalMutex sync.Mutex{} > type abc struct { > a int > b int > mu sync.Mutex{} > } > > 1. First is self explanatory, array of

Re: [go-nuts] What is the relationship between go community and goproxy.io

2022-10-09 Thread Ian Lance Taylor
On Sun, Oct 9, 2022, 10:50 AM 'ljh' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Hi, community, > > I Just saw this site: yunzhanghu.com , is listed as Special Sponsor on > goproxy.io homepage. > > I'm just curious, is goproxy.io endorsed by The Go Team and is goproxy.io >

[go-nuts] get function body comments using ast

2022-10-09 Thread Dmitry Belyaev
Hey fellow gophers, I am trying to get comments from inside of function declaration while also accessing function name, but haven't had much success. Getting name and doc is quite straightforward, I do it with: fset := token.NewFileSet() f, _ := parser.ParseFile(fset, "testfile", nil,

[go-nuts] What is the relationship between go community and goproxy.io

2022-10-09 Thread 'ljh' via golang-nuts
Hi, community, I Just saw this site: yunzhanghu.com , is listed as Special Sponsor on goproxy.io homepage. I'm just curious, is goproxy.io endorsed by The Go Team and is goproxy.io trustworthy? $ whois goproxy.io Registrant Name: REDACTED FOR PRIVACY -- You received this message because

[go-nuts] Re:What is the relationship between go community and goproxy.io

2022-10-09 Thread 'ljh' via golang-nuts
Just found another, are these two sites related: goproxy.io,goproxy.cn . -- 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

[go-nuts] Structures / mutex question

2022-10-09 Thread Slawomir Pryczek
Hi Guys, wanted to see if i making correct assumptions regarding mutexes and structures var globalMutex sync.Mutex{} type abc struct { a int b int mu sync.Mutex{} } 1. First is self explanatory, array of structures all needs to be protected by mutex x := []abc{} x = append(x,