[go-nuts] Re: ThreadSanitizer: DenseSlabAllocator overflow. Dying.

2018-04-13 Thread Krzysztof Kowalczyk
Based on https://opensource.apple.com/source/clang/clang-700.1.81/src/projects/compiler-rt/lib/tsan/rtl/tsan_dense_alloc.h.auto.html it's an internal thing to thread sanitizer. It seems to be running out of memory when trying to instrument the code. It uses a cache of fixed size of kL1Size

Re: [go-nuts] sync.Cond implementation

2018-04-13 Thread Ian Lance Taylor
On Thu, Apr 12, 2018 at 11:09 PM, Penguin Enormous wrote: > > Hi Gophers! > > I'm trying to understand line 522 of src/runtime/sema.go: > >> if atomic.Load() == atomic.Load() { >> >> ... > > > I can't help but thinking, what guarantee that the atomic read of l.wait > won't

Re: [go-nuts] Why array [10485761]bytes (10MB) moved to the heap?

2018-04-13 Thread Ian Lance Taylor
On Fri, Apr 13, 2018 at 2:07 PM, Yulrizka wrote: > > I'm playing around with slices. > Found that slice of bytes with the size more than 10485760 is moved to the > heap. Because Go stacks are copied as needed, there is a tradeoff between putting a value on the stack and

[go-nuts] Why array [10485761]bytes (10MB) moved to the heap?

2018-04-13 Thread Yulrizka
I'm playing around with slices. Found that slice of bytes with the size more than 10485760 is moved to the heap. package main import ( "fmt" "runtime/debug" "time" ) // run with escape analysis // go run -gcflags '-m -l' main.go func main() { a() fmt.Println("after a returned")

Re: [go-nuts] Re: Good Cyclomatic Complexity Number for Go

2018-04-13 Thread Alex Efros
Hi! On Fri, Apr 13, 2018 at 12:41:35PM -0700, Lee Painton wrote: > The only situation in which this limit has seemed unreasonable is when a > large number of independent cases followed a selection function (a large > case statement), which was allowed. Another situation is function which does

[go-nuts] Re: Good Cyclomatic Complexity Number for Go

2018-04-13 Thread Lee Painton
>From McCabe's paper on the topic: http://www.literateprogramming.com/mccabe.pdf These results have been used in an operationalenvironrnent by advising project members to limit their software modules by cyclomatic complexity instead of physical size. The particular upper bound that has been

[go-nuts] Re: Language is a platform, which golang still does not pay attention to !!!

2018-04-13 Thread Uzondu Enudeme
> > > > they are both not just programming languages but also platforms. They > are almost the same in Windows and Linux. That's why java and php are very > popular in recent days. Having worked with Go for just a little over a year, I would like to add that the Go community in itself has

[go-nuts] Implementing JDBC Driver

2018-04-13 Thread Ken Bailey
So at my new Job I'm the only one using Go and it's going quite well, but i'm having to extract data from our Netezza database using java or python, load it into .csv files and then work with it using Go. I'd much rather use Go for everything, especially as I'm planning to build some tools that

[go-nuts] Re: Tcp connection reset

2018-04-13 Thread Juliusz Chroboczek
> i need to reset the tcp connection manually , if one request come from > ipLayer.SrcIP > = 10.2.3.1 then i need to sent the reset connection packet I could be wrong, but I don't think the sockets API makes this possible -- RST segments are normally only sent by the kernel upon receiving a

Re: [go-nuts] Re: latest go examples

2018-04-13 Thread andrey mirtchovski
If you're looking for general examples of modern Go, perhaps the JustForFunc series will be of interest: https://www.youtube.com/channel/UC_BzFbxG2za3bp5NRRRXJSw On Fri, Apr 13, 2018 at 10:28 AM, JM wrote: > thanks. I run a software engineering team so I've been less

[go-nuts] Re: latest go examples

2018-04-13 Thread JM
thanks. I run a software engineering team so I've been less hands-on lately and want to get back into keeping my skills current. On Friday, April 13, 2018 at 10:14:08 AM UTC-6, JM wrote: > > Where can I find some examples of using go that uses the latest releases? > I went to golang.org but

Re: [go-nuts] latest go examples

2018-04-13 Thread andrey mirtchovski
Due to Go's compatibility promise most example code written since Go 1.0 should still be relevant, will compile, and will run. Libraries have grown since 1.0 as our understanding of how to write Go code improves (context.Context is one such innovation), but the examples in the documentation are

[go-nuts] latest go examples

2018-04-13 Thread JM
Where can I find some examples of using go that uses the latest releases? I went to golang.org but still looking. I am aware of gobyexample.com but not sure if it's kept updated as new builds are released. thanks. -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Tcp connection reset

2018-04-13 Thread Binu Paul
i need to reset the tcp connection manually , if one request come from ipLayer.SrcIP = 10.2.3.1 then i need to sent the reset connection packet On Fri, Apr 13, 2018 at 6:30 PM, Jesper Louis Andersen < jesper.louis.ander...@gmail.com> wrote: > TCP connections are normally Close()'d, which starts

Re: [go-nuts] [NEWBIE] syncmap - how to use it correctly

2018-04-13 Thread vadim kulibaba
Wow, thank you, Jan пятница, 13 апреля 2018 г., 15:43:51 UTC+3 пользователь Jan Mercl написал: > > On Fri, Apr 13, 2018 at 2:29 PM > wrote: > > > What i do wrong? > > The code relies on the bool value in 'ok', returned from .Load(), but that > _does not_ mean some other

Re: [go-nuts] Tcp connection reset

2018-04-13 Thread Jesper Louis Andersen
TCP connections are normally Close()'d, which starts the gracefully dance of sending FIN packets back and forth. RST is a far more abrupt situation, which is normally reserved for a few exceptional cases. I find it rare that one needs the RST from the userland outside kernel jurisdiction. Hence my

Re: [go-nuts] [NEWBIE] syncmap - how to use it correctly

2018-04-13 Thread Jan Mercl
On Fri, Apr 13, 2018 at 2:29 PM wrote: > What i do wrong? The code relies on the bool value in 'ok', returned from .Load(), but that _does not_ mean some other goroutine, once you remove the mutex.Lock(), cannot insert a value for the same key the moment the call of

[go-nuts] Re: Using log Package with log.Lshortfile Flag

2018-04-13 Thread Kaveh Shahbazian
Filed an issue . -- 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...@googlegroups.com. For more

[go-nuts] [NEWBIE] syncmap - how to use it correctly

2018-04-13 Thread vadim . kulibaba
Please explain me( I dont understand why syncmap - not sync If i try Load/Store from multiple goroutins - i have vary values with same key in syncmap If i try lock with mutex- all ok. But is syncmap not thread safe by default? Locked version of function:

[go-nuts] Tcp connection reset

2018-04-13 Thread Binu Ps
HI I need to reset tcp connection, any library available in golang ? Concept : if one connection coming from ipLayer.SrcIP = 10.2.3.1 , then i need to reset the connection (tcpLayer.RST=true;) and need to form a packet and sent request reset the

Re: [go-nuts] Did you try to handle http gzip requests?

2018-04-13 Thread Yaroslav Molochko
The problem was with my tests, I did not close gzip writer before using it, so server side code was working fine, client did not send proper gzip data. Thank you for the hints. On Thu, Apr 12, 2018 at 11:16 PM andrey mirtchovski wrote: > One suggestion for debugging is to

Re: [go-nuts] Correct way to bump a Go library to v2

2018-04-13 Thread Nick Snyder
> If you wanna support go both for v1 and v2 using current import path then > you've no choice - you have to keep both version in master. Yeah, this seems to be the case. There is an option to use gopkg.in to get alternate import path for v1. > This way users of go+v1 will have to rewrite

[go-nuts] Re: CGO linker issues

2018-04-13 Thread alex . rou . sg
Have you already checked for another declaration in sm_sdk.h? btw which go version are you on? The error message doesn't seem like the latest release. Also can you provide a self contained buildable example and build commands? On Friday, 13 April 2018 12:45:39 UTC+8, r...@soulmachines.com

[go-nuts] sync.Cond implementation

2018-04-13 Thread Penguin Enormous
Hi Gophers! I'm trying to understand line 522 of src/runtime/sema.go : if atomic.Load() == atomic.Load() { > > ... I can't help but thinking, what guarantee that the atomic read of l.wait won't return stale value,