Re: [go-nuts] Could we trade all the `ctx context.Context` arguments for one pointer in `g`?

2024-02-20 Thread 'TheDiveO' via golang-nuts
Forgive me if I missed that, but what if I have multiple context vars, because I need to pass different (derived) contexts into different functions/receivers? Take unit tests as real-world examples. On Wednesday, February 21, 2024 at 1:37:05 AM UTC+1 Sam Vilain wrote: > Alright, well thanks

Re: [go-nuts] Could we trade all the `ctx context.Context` arguments for one pointer in `g`?

2024-02-20 Thread Robert Engels
FWIW, I think having a bound context to an execution context is a valuable addition. One thing about Go that has always felt lacking is dynamic code loading execution. There is the plugin facility but it doesn’t seem to have been widely adopted. If it were, I think the Go team would find it needs

Re: [go-nuts] Could we trade all the `ctx context.Context` arguments for one pointer in `g`?

2024-02-20 Thread Sam Vilain
Alright, well thanks for your input. I do think these questions can be answered; exploring the use cases in a proposal format should hopefully show that the impact of closures would not normally be an issue.  Possibly the worst case is if you had a library to some external service, and at

Re: [go-nuts] Could we trade all the `ctx context.Context` arguments for one pointer in `g`?

2024-02-20 Thread 'Axel Wagner' via golang-nuts
If I may quote myself: > And no matter which choice you make for the language - it means that if the programmers wanted the other, they'd have to jump through annoying hoops and get confusing and hard to debug problems. Having a mechanism to get one or the other semantic doesn't change the fact

Re: [go-nuts] Could we trade all the `ctx context.Context` arguments for one pointer in `g`?

2024-02-20 Thread Sam Vilain
On 2/17/24 1:32 AM, Axel Wagner wrote: On Sat, Feb 17, 2024 at 2:09 AM Sam Vilain wrote: I would argue that the matter can be simply decided by choosing the /calling/ stack, not the destination stack. I agree that this is *one choice*. But the point is, that *sometimes* you'd want

Re: [go-nuts] heap pprof profile showing only 10Gi out of 50Gi of actually used memory

2024-02-20 Thread Kurtis Rader
Is your app built with CGO? That is, do you link it against any C/C++ code that might be calling malloc? On Tue, Feb 20, 2024 at 5:22 AM Frank Flipper wrote: > I have an app that's put inside k8s container and is being monitored in > grafana. Memory usage graph shows me that one of the pods is

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

2024-02-20 Thread Mike Schinkel
Is there no `cmd/migrations/go.mod`? Have you not tried debugging with Delve? -Mike On Tuesday, February 20, 2024 at 5:29:19 AM UTC-5 Peter Bočan wrote: > That seems to work on the repo/go.mod level, if I am not mistaken. I would > need something finer on the binary/compilation unit level. >

Re: [go-nuts] When i try to input name from keyboard it is not taking the input

2024-02-20 Thread Marvin Renich
* Marvin Renich [240220 10:52]: > * Sagar Byahatti [240220 08:22]: > > package main > > > > import "fmt" > > > > func main() { > > > > var projectName = "APY" > > var sub = 50 > > > > fmt.Println("Welcome to", projectName, " the number of subscriber is ", > > sub) > >

Re: [go-nuts] When i try to input name from keyboard it is not taking the input

2024-02-20 Thread Marvin Renich
* Sagar Byahatti [240220 08:22]: > package main > > import "fmt" > > func main() { > > var projectName = "APY" > var sub = 50 > > fmt.Println("Welcome to", projectName, " the number of subscriber is ", > sub) > fmt.Println("Enter your name: ") > var userName string > >

[go-nuts] When i try to input name from keyboard it is not taking the input

2024-02-20 Thread Sagar Byahatti
package main import "fmt" func main() { var projectName = "APY" var sub = 50 fmt.Println("Welcome to", projectName, " the number of subscriber is ", sub) fmt.Println("Enter your name: ") var userName string fmt.Scan() fmt.Printf("%v, your PRAN Number is",

[go-nuts] heap pprof profile showing only 10Gi out of 50Gi of actually used memory

2024-02-20 Thread Frank Flipper
I have an app that's put inside k8s container and is being monitored in grafana. Memory usage graph shows me that one of the pods is using 50Gi of memory, but when I go to /debug/pprof/heap I only see that it's using only 10-11Gi. I'm aware that pprof is not meant to track and show every

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

2024-02-20 Thread Peter Bočan
That seems to work on the repo/go.mod level, if I am not mistaken. I would need something finer on the binary/compilation unit level. Peter. On Tuesday 20 February 2024 at 10:19:04 UTC Jan Mercl wrote: > On Tue, Feb 20, 2024 at 11:07 AM Peter Bočan wrote: > > > Is there a way to debug this?

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

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

2024-02-20 Thread Peter Bočan
Hello Gophers! I am facing a very odd issue. I have recently joined a company and wrote a small database migration binary which is co-located in the same github repo as the service which database migrations it. For whatever reason the DB migration binary, when it runs on the cluster, it