[go-nuts] Re: why p's local run queue size is 256?

2020-01-28 Thread jin wang
but 256 run queue size, it's length is 256*8 2048byte, some cpu cache line is 32, 64, 128, 256, if run queue length is 128, half of queue size if 64*8 512byte, they can't be in the same cache line. 在 2020年1月27日星期一 UTC+8下午12:50:32,changkun写道: > > 256 run queue size is designed for the work-steal

[go-nuts] Go Module and Build Tag

2020-01-28 Thread Henry
Hi, I wonder whether it is possible to specify a dependency's build tags in go module. Let's say that Project A depends on Library B. Library B has optional features (using the *//+build*) that Project A requires. Is there any way to specify Library B's build tags in Project A's go.mod? Thanks

Re: [go-nuts] JSON: Having trouble parsing map keys with dots like {"foo.bar":"baz"}

2020-01-28 Thread Mark Hansen
Ah, thanks! Thought I might be holding it wrong. Still though, isn’t it strange that the extra space works if you don’t have the dot in the key? On Wed, 29 Jan 2020 at 00:59, Lutz Horn wrote: > Remove the blank in ``json: "baz.bar"` and make it `json:"baz.bar"`. This > works: https://play.gol

Re: [go-nuts] Go present questions

2020-01-28 Thread Gonzalo Serrano
5 years later, I just hacked some ASCII bullets and non-standard spaces like this: * More DDD *Strategical* *patterns* - Bounded Context - Ubiquitous Language *Tactical* *patterns* ● Entities: do the stuff, generate events ● Repositories: abstract the persistence ops ● Aggregates: trans

[go-nuts] Re: TCPScan -- Check TCP Connectivity

2020-01-28 Thread Rich
I didn't leave the URL to github: https://github.com/rmasci/tcpscan Sorry about that. On Tuesday, January 28, 2020 at 10:23:17 AM UTC-5, Rich wrote: > > This originally started as a learning exercise in Go Routines when going > through a course on Go Programming. I needed a real world progra

Re: [go-nuts] TCPScan -- Check TCP Connectivity

2020-01-28 Thread Richard Masci
I didn't leave the Github url -- sorry https://github.com/rmasci/tcpscan On Tue, Jan 28, 2020 at 10:23 AM Rich wrote: > This originally started as a learning exercise in Go Routines when going > through a course on Go Programming. I needed a real world programming > example, and every day it

[go-nuts] Re: go modules and internal packages

2020-01-28 Thread Manlio Perillo
On Tuesday, January 28, 2020 at 12:34:04 AM UTC+1, R Srinivasan wrote: > > Oops. That was messed up. > > I have so far not migrated towards the new go modules. I am beginning the > process. Looking for ideas. > > I split my applications into independent packages each in its own > directory. > > t

[go-nuts] [security] Go 1.13.7 and Go 1.12.16 are released

2020-01-28 Thread Katie Hockman
Hi gophers, We have just released Go 1.13.7 and Go 1.12.16 to address recently reported security issues. We recommend that all users update to one of these releases (if you’re not sure which, choose Go 1.13.7). - X.509 certificate validation bypass on Windows 10 A Windows vulnerability

Re: [go-nuts] JSON: Having trouble parsing map keys with dots like {"foo.bar":"baz"}

2020-01-28 Thread Rich
All of these are good suggestions -- but when working with JSON I find this package to be very helpful: https://github.com/hjson/hjson-go I use json as a config file for my programs and when users fat finger the config, forget a comma or put a space in the wrong place -- this for the most p

Re: [go-nuts] Why is go too slow?

2020-01-28 Thread nilsocket
Thanks a lot for your answer. Thank you. On Tuesday, January 28, 2020 at 9:15:58 PM UTC+5:30, Ian Lance Taylor wrote: > > On Tue, Jan 28, 2020 at 7:33 AM nilsocket > > wrote: > >> Attached two files main.c and main.go, >> both try to compute fib(40), 20 times on `x` no.of threads/goroutines. >>

Re: [go-nuts] Why is go too slow?

2020-01-28 Thread burak serdar
On Tue, Jan 28, 2020 at 8:33 AM nilsocket wrote: > Attached two files main.c and main.go, > both try to compute fib(40), 20 times on `x` no.of threads/goroutines. > fib(40) is recursive. > Your benchmark is flawed. Goroutines are not threads. Also, the printing of the results is included in the

Re: [go-nuts] Why is go too slow?

2020-01-28 Thread Ian Lance Taylor
On Tue, Jan 28, 2020 at 7:33 AM nilsocket wrote: > Attached two files main.c and main.go, > both try to compute fib(40), 20 times on `x` no.of threads/goroutines. > fib(40) is recursive. > > *Prerequisites for C:* > >1. libuv (https://github.com/libuv/libuv) > > > > *Compile*: > >- *C :*

Re: [go-nuts] Re: Is it considered to separate runtime and cmd/compile irrelevant standard libraries out from the core language repo and hosted in a different module, eg. std?

2020-01-28 Thread Ian Lance Taylor
On Tue, Jan 28, 2020 at 12:27 AM changkun wrote: > > - the main repo team focuses on the core language distribution (meaning a > compiler that implements language spec, a runtime package that supports all > kinds of runtime mechanism support), provides the minimum "std-only" APIs to > support a

[go-nuts] Why is go too slow?

2020-01-28 Thread nilsocket
Attached two files main.c and main.go, both try to compute fib(40), 20 times on `x` no.of threads/goroutines. fib(40) is recursive. *Prerequisites for C:* 1. libuv (https://github.com/libuv/libuv) *Compile*: - *C :* - *Unoptimized:* * gcc main.c -lpthread -luv * - *Opt

[go-nuts] TCPScan -- Check TCP Connectivity

2020-01-28 Thread Rich
This originally started as a learning exercise in Go Routines when going through a course on Go Programming. I needed a real world programming example, and every day it seems I have to perform checks for tcpconnectivity -- and worse yet our security guys didn't like putting on netcat or nmap s

Re: [go-nuts] Cgo fixed length array woes

2020-01-28 Thread Ian Lance Taylor
On Tue, Jan 28, 2020 at 4:44 AM mark mellar wrote: > > Hi Folks, I'm having some trouble instantiating a C struct from a 3rd party > API. > > I'm not sure if this is more a C question or a Go question, details in the > code below, any help would be much appreciated! > > M > > // This non-compili

[go-nuts] Scanning TCP Hosts using TCPSCAN

2020-01-28 Thread Rich
This originally started as a learning exercise in Go Routines when going through a course on Go Programming. I needed a real world programming example, and every day it seems I have to perform checks for tcpconnectivity -- and worse yet our security guys didn't like putting on netcat or nmap s

[go-nuts] Asynq - A simple asynchronous task queue library for Go ~ Contributors welcome!

2020-01-28 Thread Ken Hibino
Asynq is a simple Go library for queueing tasks and processing them in the background with workers. It is backed by Redis and it is designed to have a low barrier to entry. It should be integrated in your web stack easily. Please check it out at github.com/hibiken/asynq It's an early-stage pr

Re: [go-nuts] JSON: Having trouble parsing map keys with dots like {"foo.bar":"baz"}

2020-01-28 Thread Jake Montgomery
FYI - "go vet" will catch this. Running "go vet" is always a good idea. On Tuesday, January 28, 2020 at 9:00:05 AM UTC-5, Lutz Horn wrote: > > Remove the blank in ``json: "baz.bar"` and make it `json:"baz.bar"`. This > works: https://play.golang.com/p/i9SURYgGO66 > >

Re: [go-nuts] Use CONNECT method to proxies for HTTP requests

2020-01-28 Thread Edouard Buschini
I solved my problem. The offending line what in the request.go file for the net/http package: 558 host := cleanHost(r.Host) 559 if host == "" { 560 if r.URL == nil { 561 return errMissingHost 562 } 563 host = cleanHost(r.URL.Host) 564 } ... 571 ruri := r.URL.Reque

AW: [go-nuts] JSON: Having trouble parsing map keys with dots like {"foo.bar":"baz"}

2020-01-28 Thread Lutz Horn
Remove the blank in ``json: "baz.bar"` and make it `json:"baz.bar"`. This works: https://play.golang.com/p/i9SURYgGO66 Von: golang-nuts@googlegroups.com im Auftrag von m...@markhansen.co.nz Gesendet: Dienstag, 28. Januar 2020 12:14 An: golang-nuts Betre

[go-nuts] JSON: Having trouble parsing map keys with dots like {"foo.bar":"baz"}

2020-01-28 Thread mark
Hi folks, for background, I'm trying to read the Kaiterra API using encoding/json, which has JSON values like this: {"id":"-0001-0001--7e57c0de","*info.aqi* ":{"ts":"2018-03-26T08:53:20Z","data":{"pm10":120,"pm25":214}}} I'm having troubl

[go-nuts] Cgo fixed length array woes

2020-01-28 Thread mark mellar
Hi Folks, I'm having some trouble instantiating a C struct from a 3rd party API. I'm not sure if this is more a C question or a Go question, details in the code below, any help would be much appreciated! M // This non-compiling example demonstrates an issue I'm having integrating a 3rd party

Re: [go-nuts] go modules and internal packages

2020-01-28 Thread R Srinivasan
Thanks a bunch. Based on these, I should be including the repo name in my imports - even for private packages. If the repo changes, then the code has to be edited. For example I use an in-house instance of say bitbucket and then publish to the world on GitHub ,the sources will have to change to

Re: [go-nuts] Re: Is it considered to separate runtime and cmd/compile irrelevant standard libraries out from the core language repo and hosted in a different module, eg. std?

2020-01-28 Thread changkun
I think splitting std libraries and language core distribution may speed up and making Go development process more scalable. Literatures indicates this pattern is the critical aspect to development scalability (M.Beck, One the Hourglass model, ACM communications, https://cacm.acm.org/magazines/2