[go-nuts] Re: Is there some kind of a MaxHeapAlarm implementation?

2020-01-20 Thread Urjit Singh Bhatia
Thanks for the detailed responses everyone. I think weak-refs are definitely a good idea that could work for my use case here. I'll explore more of that implementation. @christian yeah, good point about the ticker not catching them. I think I'll try a more manual memory counting approach here s

Re: [go-nuts] Go security bugs database

2020-01-20 Thread David Riley
I strongly agree this would be beneficial. I’ve discussed this exact concept with my employer before, because it’s an area we have scanners for with older languages, but not Go. I do believe Snyk offers a commercial version of this service, but a public, official, well-vetted repository that is

[go-nuts] go test -timeout 30m can this be set inside Go code? disable timeouts programmatically?

2020-01-20 Thread Jason E. Aten
I have a long running test where I would like to set the testing package timeout to 30 minutes from with the my_test.go code. This would prevent me from forgetting to add the timeout flag, and then discovering 10 minutes later that it was needed. Is this possible? Or just a way to disable the t

Re: [go-nuts] Is there some kind of a MaxHeapAlarm implementation?

2020-01-20 Thread robert engels
This is actually SoftRef - which are like a WeakRef but they are only collected under memory pressure. If the WeakRef package works, I assume it could be modified to enable “soft ref” like functionality. It was my understanding that you need GC/runtime support to truly make this work, but maybe

Re: [go-nuts] Is there some kind of a MaxHeapAlarm implementation?

2020-01-20 Thread Eric S. Raymond
Robert Engels : > This is solved pretty easily in Java using soft references and a hard memory > cap. That'd be nice, but the onnly weak-references package I've found doesn't seem to allow more than one weakref per target. That's really annoying, because my use case is a target object for a man

[go-nuts] Go security bugs database

2020-01-20 Thread Manlio Perillo
In https://research.swtch.com/vgo-why-versions, Russ Cox wrote about an hypothetical database of bugs in Go modules. A tool can query the database, extracting the list of modules used in a binary built with Go. Such a tool can be probably be written today, using, as an example, https://www.cved

Re: [go-nuts] Is there some kind of a MaxHeapAlarm implementation?

2020-01-20 Thread Robert Engels
This is solved pretty easily in Java using soft references and a hard memory cap. Similar techniques may work here. > On Jan 20, 2020, at 11:22 AM, Christian Mauduit wrote: > > Hi, > > That is a generic question and I think that if you want to keep an approach > with a "global indicator o

Re: [go-nuts] Is there some kind of a MaxHeapAlarm implementation?

2020-01-20 Thread Christian Mauduit
Hi, That is a generic question and I think that if you want to keep an approach with a "global indicator of how much memory is used", your approach is OK. You might also want to store this information of "should I throttle" in a cache or something, the cache could be just a shared atomic flag

Re: [go-nuts] Best way to buffer upstream responses in reverse proxy

2020-01-20 Thread Prabhu Chawandi
As responses coming from upstream server, because my application acting as proxy server and it will not have visibility of the fields of the responses coming. So, think appending the characters to meet JSON format is only way. Am I right assuming so? On Mon, Jan 20, 2020 at 4:07 PM Tamás Gulácsi

[go-nuts] Is there some kind of a MaxHeapAlarm implementation?

2020-01-20 Thread Urjit Singh Bhatia
Hi folks, I am trying to figure out if someone has a decent solution for max memory usage/mem-pressure so far. I went through some of the github issues related to this (SetMaxHeap proposals and related discussions) but most of them are still under review: - https://go-review.googlesource.co

Re: [go-nuts] Re: Advise on working with local modules

2020-01-20 Thread Manlio Perillo
On Monday, January 20, 2020 at 12:26:38 PM UTC+1, Tamás Gulácsi wrote: > > Why do you want to pin to a commit when everything is in flux - develop > locally? Because to decide when the API is good for publication I want to use it in 1+ projects. Since the local development period may be long,

Re: [go-nuts] Re: Advise on working with local modules

2020-01-20 Thread Tamás Gulácsi
Why do you want to pin to a commit when everything is in flux - develop locally? The replace directive uses the current code when you declare it as a local path, not the version specified in the "require" section! -- You received this message because you are subscribed to the Google Groups "go

[go-nuts] Re: run tests for all sub modules

2020-01-20 Thread Vasiliy Tolstov
So this is impossible with per package modules in one repo? вс, 19 янв. 2020 г. в 02:39, Vasiliy Tolstov : > > Hi! I have one repo with multiple packages. For each package i have > dedicated go.mod (this is a requirement because repo is collection of > plugins with many deps). > How to run test f

Re: [go-nuts] Re: Advise on working with local modules

2020-01-20 Thread Paul Jolly
>> Why not just the replace directive in go.mod? > > With the replace directive to a local module, the version is ignored and the > go tool always use the latest commit. How are you envisaging that local modules be addressed by commit, given the target is a directory (where by definition only a s

Re: [go-nuts] Best way to buffer upstream responses in reverse proxy

2020-01-20 Thread Tamás Gulácsi
Please define "better". For complexity and speed, appending "[", inserting ",", and appending "]" at the end is the simplest and fastest solution. If you want to check for syntax and completeness, then you should unmarshal, append, and then marshal again. But if not needed, it's just complexity

[go-nuts] Goroutine ported to Haskell, do you Gophers think the marriage with STM done right there ?

2020-01-20 Thread Compl Yue
https://github.com/e-wrks/edh#program-concurrency-and-data-consistency-as-a-whole I'm the author of Edh FYI, just released it to public. Best regards, Compl -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and sto

Re: [go-nuts] Best way to buffer upstream responses in reverse proxy

2020-01-20 Thread Prabhu Chawandi
Yes, I also need to put '[' at first and ']' at last position. But I was checking if there is any better way to do it. I was even having question how can someone make it better without unmarshalling JSON and remarshalling merged object. On Mon, Jan 20, 2020 at 4:12 AM Tamás Gulácsi wrote: > Jus

Re: [go-nuts] New tutorial series: Terminal-based Tetris - Part 1: Procedural polyomino generation

2020-01-20 Thread Michael Baldry
This is cool but the post feels like you are just listing code, without much in the way of explanation of what those code blocks are doing, why you need them and what purpose they have in the grand scheme of the project - I know there is a small paragraph for each one, but I don't think that is eno