[go-nuts] Re: memory issues

2023-02-09 Thread James Dornan
s possible. > Also mention which libs you use or make a playground version of the > problem, so people might be able to understand more about the problem. > > Op donderdag 9 februari 2023 om 00:03:03 UTC+1 schreef James Dornan: > >> I have a go web service that acts as a proxy th

[go-nuts] memory issues

2023-02-08 Thread James Dornan
I have a go web service that acts as a proxy that gets XML documents from a remote system and processes them through XSLT, returning the result, if any. I have tried a number of options over the last few days and cannot seem to nail down the cause. Does anyone know how to address this or debug

Re: [go-nuts] fs.Glob, fs.DirWalk, etc. does the pattern support complex regex

2022-11-03 Thread James
It makes the pattern a bit ugly, but you can definitely do it with path.Match https://go.dev/play/p/zi6nh8Vj9LF On Fri, 4 Nov 2022 at 09:20, pat2...@gmail.com wrote: > This has to be a FAQ, but my google foo for searching it is not clear > The docs say: " The syntax of patterns is the same as

Re: [go-nuts] cgo binding copies data twice, necessary?

2022-08-23 Thread James
Assuming that `p.privateKey = *((*C.private_key)(key))` is making a full copy, not shallow. I think you could avoid using `C.CBytes`. You can get the address of the start of the backing array via [0] as per https://pkg.go.dev/cmd/cgo So maybe something like this: p.privateKey =

Re: [go-nuts] go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 not working

2022-07-23 Thread James Brooke
July 2022 at 02:13:40 UTC+1 kra...@skepticism.us wrote: > On Fri, Jul 22, 2022 at 6:03 PM James Brooke wrote: > >> - I simply tried to run that command in the terminal. I'm able to develop >> go programs fine in GoLand, pulling in 3rd party dependencies etc. I just >>

Re: [go-nuts] go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 not working

2022-07-22 Thread James Brooke
CFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/hq/0vgn198d7v5_kkhc5y8bz8r4gq/T/go-build3791061883=/tmp/go-build -gno-record-gcc-switches -fno-common" >From what I can recall I installed go

[go-nuts] go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 not working

2022-07-22 Thread James Brooke
Hello, I'm struggling to work out why this isn't working. I'm getting the following, any help greatly appreciated. ../../../go/pkg/mod/google.golang.org/protobuf@v1.28.0/compiler/protogen/protogen.go:14:2: package bufio is not in GOROOT (/usr/local/go/src/bufio)

[go-nuts] Re: How to call function from struct in slice?

2022-06-04 Thread James Lei
I tried your solution and it still can't find .ModuleName(), modules := vendorpackages.CompileModules() for _, module := range modules { mod, ok := module.(*AddModule) if !ok { //error handling if module is not of type AddModule } fmt.Println(mod.ModuleName()) //

[go-nuts] Re: How to call function from struct in slice?

2022-06-04 Thread James Lei
To add on, the return value of mod is "" fmt.Println(mod) On Saturday, 4 June 2022 at 11:40:15 UTC+8 Henry wrote: > You need to cast the generic interface{} to its appropriate type. For > instance: > > ``` > modules := CompileModules() > for _, module := range modules { > mod, ok :=

[go-nuts] Re: How to call function from struct in slice?

2022-06-04 Thread James Lei
I have nearly solve the problem, except I have to use cast as mod.(*Example1.AddModule) which is wrong. How do you cast as mod.(*AddModule)? On Saturday, 4 June 2022 at 11:40:15 UTC+8 Henry wrote: > You need to cast the generic interface{} to its appropriate type. For > instance: > > ```

[go-nuts] Re: Recommended RESTful API web service implementation after 10 years of Go?

2022-05-12 Thread James Mackerel
checkout this 在2022年5月13日星期五 UTC+8 06:30:04 写道: > There is an official one in Golang documentation: > Tutorial: Developing a RESTful API with Go and Gin > https://go.dev/doc/tutorial/web-service-gin > > I find Gin framework especially good.

[go-nuts] Autocert behavior for IP address lookups?

2022-01-31 Thread James Wendel
) { panic(http.ListenAndServe(getHTTPPort(), m.HTTPHandler(nil))) }() panic(s.ListenAndServeTLS("", "")) Thanks, -James -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsu

Re: [go-nuts] Re: A peculiar sort problem

2021-07-27 Thread James
It could be that .NET is using some locale based collation. Seems like a lot of machinery, but might do the trick https://pkg.go.dev/golang.org/x/text@v0.3.6/collate On Wed, 28 Jul 2021 at 06:52, jake...@gmail.com wrote: > Personally I would be careful about assuming that was the only sorting >

Re: [go-nuts] go install, replace directive any ongoing discussions?

2021-03-07 Thread James Lawrence
topic in the > Google Groups "golang-nuts" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/golang-nuts/10AJZaH9OFU/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > golang-nuts+unsubscr...@googlegroups.

Re: [go-nuts] go install, replace directive any ongoing discussions?

2021-03-07 Thread James Lawrence
well an issue <https://github.com/golang/go/issues/44840> was filed, and promptly closed. On Sun, Mar 7, 2021 at 6:36 AM James Lawrence wrote: > I read through those issues Paul, I found them less than convincing for > the global go install use case. regardless I'll file an iss

Re: [go-nuts] go install, replace directive any ongoing discussions?

2021-03-07 Thread James Lawrence
groups.google.com/d/msgid/golang-nuts/CAEkBMfGwcwp3if-zgQYN3HL5c%2BPedafuS6uz%2BtPBymHasFSzyw%40mail.gmail.com > <https://groups.google.com/d/msgid/golang-nuts/CAEkBMfGwcwp3if-zgQYN3HL5c%2BPedafuS6uz%2BtPBymHasFSzyw%40mail.gmail.com?utm_medium=email_source=footer> > . > -- James Lawrence --

[go-nuts] go install, replace directive any ongoing discussions?

2021-03-06 Thread James Lawrence
I missed the conversation originally. however go install has been left in a unfortunate state where it bewilderingly errors out when the main module contains a replace directive. I'm primarily wondering where I should be going to contribute to that conversation and if there is someone on the

[go-nuts] go/build - how to locate source without making network calls?

2020-07-02 Thread James Lawrence
I've been playing with the go/build package for resolving go package information for a few projects of mine and noticed some unexpected behavior. mainly it seems to reach out to the network even when all the information is available locally. if I turn off my network my code fails whereas go

Re: [go-nuts] Why not use F in generic?

2020-06-22 Thread James L
Have you read other thread which have been answered many times? On Tue, 23 Jun 2020 at 12:46 AM, wrote: > I read the new generic draft. And I know F,F[T],F《T》 is discarded. I > think put the type paremeter in front of the function name may be better. > No ambiguous and more readable code. > >

[go-nuts] Re: Getting 410 error from https://sum.golang.org/lookup/github.com for a private github repo

2020-05-27 Thread James Mackerel
You may try: export *GONOSUMDB*="github.com/mycompany/*,github.com/secret/*" to disable sum check for some libraries. But try **not** to do this: > $export GOSUMDB=off or you may face security issue. -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Is it acceptable to make the optional parameter as varargs

2020-05-24 Thread James
This reminds me of functional options which I think are used quite widely for this purpose. See https://dave.cheney.net/2014/10/17/functional-options-for-friendly-apis and https://github.com/tmrts/go-patterns/blob/master/idiom/functional-options.md On Mon, 25 May 2020 at 14:57, Amarjeet Anand

[go-nuts] Re: x509.ParsePKCS1PrivateKey fails to parse key generated with openssl

2020-04-21 Thread James Mackerel
.pem seems like a pkcs8 encoded key, and rsakey.pem seems like a pkcs1 key. That may be the reason why you got an error when you try to parse a pkcs8 private key with ParsePKCS1PrivateKey. James -- You received this message because you are subscribed to the Google Groups "golang-nuts&q

[go-nuts] Re: SIGILL running 1.14 on macOS

2020-03-17 Thread James Pettyjohn
Sooner the better, it's crept into downstream packages. E.g. docker installed via brew is toast as it was built in 1.14. On Wednesday, March 4, 2020 at 1:16:13 PM UTC-8, Jon Conradt wrote: > > You can follow the progress toward 1.14.1 via > https://github.com/golang/go/milestone/137 > > Looking

[go-nuts] Re: SIGILL running 1.14 on macOS

2020-02-26 Thread James Pettyjohn
Looks like this was already resolved for 1.14.1 <https://github.com/golang/go/issues/37459>. On Wednesday, February 26, 2020 at 11:00:24 AM UTC-8, James Pettyjohn wrote: > > A little further digging shows that VZEROUPPER is part of the AVX > instruction set, not supported on any

[go-nuts] Re: SIGILL running 1.14 on macOS

2020-02-26 Thread James Pettyjohn
it's better than cutting off support for these machines which can run High Sierra. Once support for High Sierra is dropped then it should not matter as it takes a 2013 or later model to run anything after High Sierra. - James On Wednesday, February 26, 2020 at 10:29:33 AM UTC-8, James Pettyjohn

[go-nuts] SIGILL running 1.14 on macOS

2020-02-26 Thread James Pettyjohn
I am trying to run go1.14 on macOS 10.13.2 with on a late 2009 iMac with an i7 but always get the same crash: SIGILL: illegal instruction PC=0x1066040 m=0 sigcode=1 goroutine 1 [running, locked to thread]: runtime.asyncPreempt() /usr/local/go/src/runtime/preempt_amd64.s:8

[go-nuts] Marshaling structs to command line arguments

2019-09-11 Thread James Pettyjohn
Hi, While not the most likely of scenarios, I'm having to write a lot of integration around existing command line tools and want a better way then passing strings/constants around. While there are ample choices to go from command line arguments to structs etc, I'm not finding anything besides

Re: [go-nuts] Parsing go.mod

2019-09-03 Thread James Pettyjohn
nd get JSON output. > > go help mod edit > > will given you the types you can then use to unmarshal the JSON. > > Failing that, the code that Dan referenced has been factored out into: > > https://godoc.org/github.com/rogpeppe/go-internal/modfile > > On Tu

Re: [go-nuts] Parsing go.mod

2019-09-03 Thread James Pettyjohn
ing protoc (that has been asked quite a few times, >> total hack, but works). >> >> go list -f {{.Version}} -m example.com/blah >> >> Note that if you have a replace directive for example.com/blah then >> the replace target might have a version. >> >&g

Re: [go-nuts] Parsing go.mod

2019-09-03 Thread James Pettyjohn
, total hack, but works). Best, James On Monday, September 2, 2019 at 10:58:53 PM UTC-7, Kurtis Rader wrote: > > On Mon, Sep 2, 2019 at 10:44 PM James Pettyjohn > wrote: > >> This might be a bad idea but I'm trying to parse the go.mod file for data >> as part of my build proc

Re: [go-nuts] Parsing go.mod

2019-09-03 Thread James Pettyjohn
Thanks. I saw the same being done by vgo - might be viable. On Monday, September 2, 2019 at 10:52:45 PM UTC-7, kortschak wrote: > > Not really exposed, but there is code you could copy. > > https://golang.org/pkg/cmd/go/internal/modfile/#Parse > > On Mon, 2019-09-02 at

[go-nuts] Parsing go.mod

2019-09-02 Thread James Pettyjohn
Hi, This might be a bad idea but I'm trying to parse the go.mod file for data as part of my build process - if at all possible I'd like to avoid duplicating the data that is already there in another file. Is there an exposed package that can be used for this? - J -- You received this

Re: [go-nuts] How do you keep your modules up-to-date?

2019-05-30 Thread James Hartig
t that solved. > > -- Marcin > > On Thu, May 30, 2019 at 7:55 AM James Hartig > wrote: > >> What's the best way to automatically always pull the latest >> release/commit for certain repos? We use gerrit internally so all of our >> import paths for internal

[go-nuts] How do you keep your modules up-to-date?

2019-05-30 Thread James Hartig
What's the best way to automatically always pull the latest release/commit for certain repos? We use gerrit internally so all of our import paths for internal packages start with something like gerrit.corp. We have over 50 different repos and it would be painstaking to have to update (pull

[go-nuts] Re: C program calling a buildmode=c-shared shared object, which calls a plugin.

2019-01-20 Thread james . ronaldo . second
I have the same problem with latest version (1.11.4). I've been trying to use two shared objects A and B (with c-shared build mode), and use my C++ program to pass the functions exported by A to B through GoInterface parameters. However, in B the type assertion from GoInterface failed... Any

Re: [go-nuts] Strange behaviour of left shift

2018-12-05 Thread James Bardin
On Wednesday, December 5, 2018 at 11:55:25 AM UTC-5, Michel Levieux wrote: > > Well the only thing I do in the main is : > > fmt.Println(v) >> > > Shouldn't the compiler statically type v to uint64? > I don't get the need to force type of v to uint64? > > Nope. You're passing an untyped constant

[go-nuts] Re: Strange behaviour of left shift

2018-12-05 Thread James Bardin
On Wednesday, December 5, 2018 at 11:36:32 AM UTC-5, Michel Levieux wrote: > > which I assume works pretty well. But if I do the same in a test main and > try to 'go run' it, with this line : > > const v = 1 << 64 - 1 >> >> > I get the following error : > > ./testmain.go:8:13: constant

[go-nuts] Re: go language sensitive editor?

2018-11-23 Thread Jeremiah James
A vote for Goland from me. -- 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 options, visit

[go-nuts] Re: Local cache of dependencies

2018-08-23 Thread James Warren
Cheers, James On Wednesday, August 22, 2018 at 11:34:14 PM UTC+1, Conor Hackett wrote: > > Hey Guys, > > So, adding your "vendor" directory to SCM is a contentious topic at best. > > I personally would rather not vendor the dependencies but I do need to > keep

[go-nuts] Help debugging atomic.AddInt64 usage

2018-08-02 Thread James Hartig
We are having a weird case where an atomic number was increasing and not decreasing, despite calls to decrease it. Hopefully, someone on the list can point out something I'm doing wrong with the atomic package. The function with the issue is: func UnhealthyOverConcurrent(prefix string, limit

[go-nuts] Re: Go routines hanging

2018-05-05 Thread James Bardin
On Saturday, May 5, 2018 at 9:30:25 AM UTC-4, s...@whites.team wrote: > > Hi James, > > Thanks for the tip - could you elaborate on your idea of a 'busy loop'? Is > this a loop that is blocked, or just one that is currently operating on > something? I'm not sure wha

[go-nuts] Re: Go routines hanging

2018-05-05 Thread James Bardin
On Saturday, May 5, 2018 at 6:27:54 AM UTC-4, s...@whites.team wrote: > > debug.SetGCPercent(-1) > stops the issue occurring - so I think we're onto a winner with the > garbage collection idea! Is there something I'm doing wrong that is causing > this GC binning off all of my go routines? >

Re: [go-nuts] High precision timer data?

2018-03-06 Thread James Chacon
I have a hard time believing that will have anywhere near < 100ns granularity considering time.Sleep has microsecond only in testing. James On Mon, Mar 5, 2018 at 5:00 AM, Frederic Landais <frederic.land...@gmail.com > wrote: > Hello, > > have you considered using time.

Re: [go-nuts] High precision timer data?

2018-03-04 Thread James Chacon
. Reading code it looks like it parks the goroutine for X time and I'm doubting scheduling latency is down in the low nanoseconds right now. So either simulating using something known with low cost (like back/back time.Now() calls) or invoking inlined assembly it looks like. James On Sat, Mar 3

Re: [go-nuts] High precision timer data?

2018-03-03 Thread James Chacon
On Thu, Mar 1, 2018 at 11:59 PM, James Chacon <chacon.ja...@gmail.com> wrote: > > > On Thu, Mar 1, 2018 at 11:07 PM, James Chacon <chacon.ja...@gmail.com> > wrote: > >> >> >> On Thu, Mar 1, 2018 at 10:13 AM, Ian Lance Taylor <i...@golang.org> >

Re: [go-nuts] High precision timer data?

2018-03-02 Thread James Chacon
On Thu, Mar 1, 2018 at 11:07 PM, James Chacon <chacon.ja...@gmail.com> wrote: > > > On Thu, Mar 1, 2018 at 10:13 AM, Ian Lance Taylor <i...@golang.org> wrote: > >> On Thu, Mar 1, 2018 at 8:56 AM, James Chacon <chacon.ja...@gmail.com> >> wrote: >>

[go-nuts] High precision timer data?

2018-03-01 Thread James Chacon
for determining how much to sleep? i.e. effectively a mini benchmark on startup to determine local machine average run time and assume some slop? James -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiv

[go-nuts] if i catch resp.StatusCode != http.StatusOK and return early from my function, do i still have to close resp.Body??

2018-01-28 Thread James Bardin
Yes, always close the body in order to ensure the network connection is released. If you want to be able to reuse the connection, you should attempt to consume the body as well. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

[go-nuts] Go as your first language

2018-01-15 Thread James Pettyjohn
a knowledge of another language. Are there tracks of knowledge to take someone from 0 to understanding baseline knowledge? And from there through taking them to a professional grade standard? Best, James -- You received this message because you are subscribed to the Google Groups "golang

Re: [go-nuts] SIGSEGV during build of Go from source

2018-01-15 Thread James Waldrop
Just to confirm, this indeed fixed things. Thanks for the quick response! On Mon, Jan 15, 2018 at 2:31 PM, James Waldrop <jwald...@gmail.com> wrote: > Aha, I did. I was cross compiling. Thank you! > > On Mon, Jan 15, 2018 at 2:27 PM Ian Lance Taylor <i...@golang.org> wrote

Re: [go-nuts] SIGSEGV during build of Go from source

2018-01-15 Thread James Waldrop
Aha, I did. I was cross compiling. Thank you! On Mon, Jan 15, 2018 at 2:27 PM Ian Lance Taylor wrote: > On Mon, Jan 15, 2018 at 1:43 PM, wrote: > > > > My bootstrap Go is a 1.9.2 binary, and I'm trying to compile Go on High > > Sierra (MacOS 10.13.2). > >

[go-nuts] Re: Why does http client try to connect via IPv6 address when IPv6 is not enabled on machine

2018-01-02 Thread James Bardin
The net dialer sorts the addresses according to RFC6724, which means that since you don't have ipv6 enabled they go to the end of the list, but doesn't remove them entirely. Also if you're using the DefaultTransport from the net/http package, it has DualStack enabled which means that ipv4 and

[go-nuts] Re: What does the 1st :8 do in -- slice := (*[1 << 30]byte)(unsafe.Pointer())[:8:8]

2017-12-13 Thread James Bardin
On Wednesday, December 13, 2017 at 8:49:07 AM UTC-5, M.P. Ardhanareeswaran wrote: > > var i uint64 = 0xdeedbeef01020304 >> >> slice := (*[1 << 30]byte)(unsafe.Pointer())[:8:8] >> >> The fist 8 is the length, and the second is capacity. See "Full Slice Expressions" specification here:

Re: [go-nuts] Problems with JSON Marshal/UnmarshalText aand maps

2017-11-27 Thread James
Think UnmarshalText needs to have a pointer receiver or you'll only be modifying a copy of the struct On 27 November 2017 at 23:13, Henrik Johansson wrote: > Hi, > > https://play.golang.org/p/bLiYSsKL_7 > > I have perhaps missed something simple or misunderstood the

Re: [go-nuts] Re: Should net.Conn transform function retain the original data segmentation?

2017-11-20 Thread James Bardin
On Mon, Nov 20, 2017 at 12:01 PM, James Bardin <j.bar...@gmail.com> wrote: > Though in this case I assume you must be using a TCP connection, so there > is no concept of a "message" and hence to direct connection between the > write size and the read size. If something ot

[go-nuts] Re: Should net.Conn transform function retain the original data segmentation?

2017-11-20 Thread James Bardin
Dave, should I then file a bug against net.UDPConn? ;) Though in this case I assume you must be using a TCP connection, so there is no concept of a "message" and hence to direct connection between the write size and the read size. If something other than UDP is expecting the full message in a

[go-nuts] Re: Why bytes Buffer's ReadFrom method blocked when read from a UDP connection?

2017-09-20 Thread James Bardin
You shouldn't use bufio around a UDP connection. The reads are a fixed size, so there's no "batching" of reads that could happen, and you can't do a partial read of a UDP packet, so you're going to lose data as soon if the buffer attempts to top off with a read smaller than the next packet

[go-nuts] Re: How to run escape analysis on subpackage

2017-09-14 Thread James Bardin
On Thursday, September 14, 2017 at 10:58:27 AM UTC-4, Diego Medina wrote: > > > go build -gcflags "-m -m" github.com/me/project-name/packagea and nothing > prints out, > > > Nothing printed because it was already installed. You could update the timestamp on any of the package files, remove

[go-nuts] Re: net: unclear how to confirm synchronously that a net.TCPListener is closed

2017-09-11 Thread James Bardin
On Monday, September 11, 2017 at 5:53:10 AM UTC-4, Shivaram Lingamneni wrote: > > > 1. Using `Listener.Close()` to interrupt the `Listener.Accept()` call > on the other goroutine > 2. Using a channel to tell the other goroutine that it should call > `Listener.Close()` itself and exit > 3.

Re: [go-nuts] Extending image.Image with Set

2017-09-04 Thread James
I think your ImageSetter is already in the standard library https://golang.org/pkg/image/draw/#Image It's a little bit subtle because different packages have the immutable Image and mutable Image It might save you some work by using golang.org/x/image library which already has affine transforms.

[go-nuts] Re: Go 1.9 introduced error on UDP Multicast JoinGroup

2017-08-28 Thread James Bardin
On Sunday, August 27, 2017 at 7:36:22 PM UTC-4, oldCoderException wrote: > > No. I just downloaded and used 1.9 on its release last week. I've > reverted to 1.8.3 for now and, as mentioned, it's working fine for me. > > >>> Are you certain you also have the latest version of

[go-nuts] Re: runtime.GOOS case

2017-08-07 Thread James Bardin
They will always be lowercase, as the values are all defined in the code const GOOS = `android` const GOOS = `darwin` const GOOS = `dragonfly` const GOOS = `freebsd` const GOOS = `linux` const GOOS = `nacl` const GOOS = `netbsd` const GOOS = `openbsd` const GOOS = `plan9` const GOOS = `solaris`

Re: [go-nuts] Re: HTTP/2 multiplexing

2017-08-02 Thread James Abley
A goroutine making each request, passing in the http.Client should work. Something like http://blog.narenarya.in/concurrent-http-in-go.html On Wed, 2 Aug 2017 at 18:58 wrote: > Parallel in the sense of HTTP/2 multiplexing, i.e. sending the next > request without having

[go-nuts] Re: HTTP/2 multiplexing

2017-07-30 Thread James Abley
On Thursday, 13 July 2017 15:56:27 UTC+1, pala.d...@gmail.com wrote: > > Hello, I'm trying to understand how to write an HTTP client using the > standard HTTP package and which takes advantage of HTTP/2 multiplexing > (i.e. send many requests "in parallel" using the same TCP connection). > >

Re: [go-nuts] Overriding cgo version

2017-07-19 Thread James Pettyjohn
dependency (making it then consistent with collate). Best, James On Wednesday, April 26, 2017 at 5:06:57 PM UTC-7, Ian Lance Taylor wrote: > > [ + mpvl ] > > On Wed, Apr 26, 2017 at 4:39 PM, James Pettyjohn <japet...@gmail.com > > wrote: > > I just updated my depe

Re: [go-nuts] Different behaviour in select when using SendStmt versus default CommCase

2017-07-13 Thread James Abley
On Thursday, 13 July 2017 04:56:25 UTC+1, Ian Lance Taylor wrote: > > On Wed, Jul 12, 2017 at 8:56 AM, James Abley <james...@gmail.com > > wrote: > > > > Labels for clarity: > > > > 1. goroutine 1 spawns goroutine 2 to read from Oregon, and spawns &

Re: [go-nuts] Different behaviour in select when using SendStmt versus default CommCase

2017-07-12 Thread James Abley
On Wednesday, 12 July 2017 13:57:16 UTC+1, Ian Lance Taylor wrote: > > On Wed, Jul 12, 2017 at 12:28 AM, <james...@gmail.com > > wrote: > > > > On Wednesday, 12 July 2017 04:44:43 UTC+1, Ian Lance Taylor wrote: > >> > >> On Tue, Jul 11,

Re: [go-nuts] Different behaviour in select when using SendStmt versus default CommCase

2017-07-12 Thread james . abley
On Wednesday, 12 July 2017 04:44:43 UTC+1, Ian Lance Taylor wrote: > > On Tue, Jul 11, 2017 at 12:27 PM, <james...@gmail.com > > wrote: > > > > This caught me out recently; there's definitely a gap in my > understanding as > > to how select works. Ma

[go-nuts] Different behaviour in select when using SendStmt versus default CommCase

2017-07-11 Thread james . abley
This caught me out recently; there's definitely a gap in my understanding as to how select works. Maybe it's caught other people out too? For one of my clients, I'd written an application that would try to read data from a backend. There were multiple instances of this backend (say one in

[go-nuts] Re: Do we need to close response.Body before closing it?

2017-07-05 Thread James Bardin
On Wednesday, July 5, 2017 at 6:50:10 AM UTC-4, Yulrizka wrote: > > > So in conclusion my question is do we need to always read the resp.Body > before closing it? > > Yes, you need to read the body to reuse the connection, otherwise there may be still be data waiting to be read. You dug

[go-nuts] Re: why this goroutine always faster than main goroutine?

2017-06-20 Thread James Bardin
It's only polite to let other's know when cross-posting questions, to avoid wasting time. https://stackoverflow.com/questions/44657084/why-main-goroutine-always-be-the-second-to-be-invoked The answer and comments there seems to cover most aspects of the behavior you're seeing. On Tuesday,

Re: [go-nuts] Re: KVs store for large strings

2017-06-15 Thread James Pettyjohn
structure in the old code using a struct {x string, y string} for its first level key which I thought odd. Not sure what effects that would have on things. Best, James On Thursday, June 15, 2017 at 8:17:47 AM UTC-7, ksug wrote: > > There were mistakes with the code I posted. Oh well, in a

[go-nuts] KVs store for large strings

2017-06-14 Thread James Pettyjohn
is memory overhead. And it cannot preclude periodic reload while doing dev. Is there a data structure or lib that suits this scenarios more than others? Best, James -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] Re: Go install speedup within docker

2017-06-12 Thread James Pettyjohn
run as it's own base image, e.g. dockerfile: FROM scratch COPY bin/pjt /bin/pjt ENTRYPOINT ["/bin/pjt"] Turning off netgo increased the build by 6 megs, but 43 over 37MB is worth the tradeoff for quick rebuilds. And for the use case where it's using docker - it still works. This procedure is

[go-nuts] Re: Go install speedup within docker

2017-06-11 Thread James Pettyjohn
go1.7.5 Git commit: 3a232c8 Built:Tue Feb 28 07:52:04 2017 OS/Arch: linux/amd64 Experimental: false Running on macOS. Best, James On Sunday, June 11, 2017 at 7:00:18 AM UTC-7, Vladimir Varankin wrote: > > Hey James, > > Could you show the docker run command, which y

[go-nuts] Go install speedup within docker

2017-06-10 Thread James Pettyjohn
e folder on the host, and try to build the project without changing any files then it takes the full time again. What could cause go install to disregard this separate build done? Best, James -- You received this message because you are subscribed to the Google Groups "golang-nuts&qu

[go-nuts] Re: In-memory secondary index

2017-06-06 Thread James Pettyjohn
yet know you want :-) > > On Monday, June 5, 2017 at 3:28:33 AM UTC-7, James Pettyjohn wrote: >> >> I'm loading a set of structs in memory and will be frequently using them >> throughout the lifetime of the application and doing frequent 'queries' >> against the set to ge

Re: [go-nuts] Re: http: TLS handshake error from :: EOF

2017-05-17 Thread James Hartig
was never started. Should I file a bug to remove the log in that case? On Wednesday, May 3, 2017 at 9:45:00 AM UTC-4, James Hartig wrote: > > We're also seeing 100k of these errors per day per server. The majority of > the time its just a result of: > client SYN > server SYN-A

Re: [go-nuts] Re: http: TLS handshake error from :: EOF

2017-05-03 Thread James Hartig
We're also seeing 100k of these errors per day per server. The majority of the time its just a result of: client SYN server SYN-ACK client FIN server FIN-ACK or client SYN server SYN-ACK Retransmission Retransmission RST ... The error if the version is unsupported is: http: TLS handshake

[go-nuts] Re: How to set value to empty interface{}

2017-04-11 Thread James Bardin
On Tuesday, April 11, 2017 at 10:10:25 AM UTC-4, Th3x0d3r wrote: > > AFAIK empty interfaces{} are passed by reference > > Nothing in go is "pass by reference". The interface value is always copied. -- You received this message because you are subscribed to the Google Groups "golang-nuts"

[go-nuts] Recommended design pattern for real-time monitoring and control of an observatory

2017-04-05 Thread James McHugh
it all together. Any suggestions or ideas to get me started? I'm worried if I start off with just a bunch of if statements and for loops it will quickly become a huge mess. Regards James -- You received this message because you are subscribed to the Google Groups "golang-nuts&q

[go-nuts] Re: Shiny examples don't work on macOS Sierra 10.12.4

2017-04-01 Thread James Bardin
See https://golang.org/issue/19734 On Saturday, April 1, 2017 at 1:39:36 PM UTC-4, Dmitry Kravchenko wrote: > > After update to macOS Sierra 10.12.4 Shiny examples don't work anymore. > > iMac-Dmitry:~ dmitrykravchenko$ go env > > GOARCH="amd64" > > GOBIN="/Users/dmitrykravchenko/gowsp/bin" > >

[go-nuts] Re: I cannot understand this channel behavior, is one channel ops affect another channel ops

2017-04-01 Thread James Bardin
Wasn't this already answered for you here? https://stackoverflow.com/questions/43152776/is-it-one-channel-ops-affect-another-channel-ops On Saturday, April 1, 2017 at 1:35:12 PM UTC-4, Khalid Adisendjaja wrote: > > I made this simple script, trying to understand how is channel working, >

[go-nuts] Missing x509.MarshalPKCS8PrivateKey

2017-03-24 Thread James Hartig
There's x509.ParsePKCS8PrivateKey but no x509.MarshalPKCS8PrivateKey, which is unlike the other x509.ParseTPrivateKey and x509.MarshalTPrivateKey combinations. It seems trivial, so I'm curious why it was omitted? Assuming no objections, I'd be willing to make a patch in gerrit adding this. --

[go-nuts] Golang http reverse proxy in production

2017-03-21 Thread James Pettyjohn
I'm looking at using the stock HTTP reverse proxy, briefly looking at the implementation it seems to be ready to withstand a production workload. Any cautions or caveats in going this route? - J -- You received this message because you are subscribed to the Google Groups "golang-nuts" group.

[go-nuts] Re: Project architecture

2017-03-12 Thread James Pettyjohn
I tried this once and I don't know that I effectively decoupled the direct cgo dependency. Any pointers on effectively doing this? On Saturday, March 11, 2017 at 11:22:03 PM UTC-8, Tamás Gulácsi wrote: > > Factor out the cgo related part into a wrapper package (subdir), that will > help with

[go-nuts] Re: Project architecture

2017-03-12 Thread James Pettyjohn
M > > > On Saturday, March 11, 2017 at 9:00:43 PM UTC-8, James Pettyjohn wrote: >> >> I'm looking at the pros and cons of how to architect a web project. >> >> 1) One is a single go project for a site. No service dependencies for the >> backend at all. Cer

[go-nuts] Project architecture

2017-03-11 Thread James Pettyjohn
I'm looking at the pros and cons of how to architect a web project. 1) One is a single go project for a site. No service dependencies for the backend at all. Certain aspects of this means a cgo dependency which is not ideal as it complicates containerization and slows build time. One plus to

[go-nuts] Re: gwenn/gosqlite, go1.8, runtime error: cgo argument has Go pointer to Go pointer

2017-03-08 Thread James Bardin
That package documents the behavior on all the relevant methods: > Cannot be used with Go >= 1.6 and cgocheck enabled. If you trust the author to have written something that is correct despite the checks done by cgo, you can disable cgocheck to use those methods. On Wednesday, March 8, 2017

Re: [go-nuts] sort.Slice arguments

2017-03-08 Thread James Bardin
On Wednesday, March 8, 2017 at 10:01:08 AM UTC-5, Val wrote: > > > - or the code in the less function will have to refer to the same > (unnamed) resliced portion, which is imo convoluted : fix 1 > or fix 2 > . >

Re: [go-nuts] A naive question, why not move the len and cap fields of string and slice types into the underlying types?

2017-03-03 Thread James Bardin
On Friday, March 3, 2017 at 11:47:10 AM UTC-5, T L wrote: > > > Yes, the suggestion needs more allocations in creating new string and > slice values. > But it makes copying string and slice values a little faster and a little > less memory consuming. > > In most cases there is no difference

[go-nuts] Re: Problem calling http.HandlerFunc

2017-03-03 Thread James Bardin
The method expression (*Api).ListHandler yields a function with the signature func(*Api, http.ResponseWriter, *http.Request) To use the method value with the signature func(http.ResponseWriter, *http.Request) you need an instance of `*Api` to call its method, so you can't

Re: [go-nuts] Slice from interface doesn't work as expected

2017-03-02 Thread James Bardin
All assignments are a copy, so there's no way to modify a slice value that is in an interface{} Just like if this were a function argument, you will need a pointer in order to modify the value. https://play.golang.org/p/kOdXUCiT_F On Thursday, March 2, 2017 at 9:01:48 AM UTC-5, Cornel

[go-nuts] Re: Building golang on MIPS using gccgo

2017-02-28 Thread James Cowgill
Hi, On 28/02/17 17:30, Ian Lance Taylor wrote: > On Tue, Feb 28, 2017 at 7:33 AM, James Cowgill <james.cowg...@imgtec.com> > wrote: >> >> Stumbling over this thread: >> https://groups.google.com/forum/#!topic/golang-nuts/waTy56I_KWQ >> >> On 25/03/16

[go-nuts] Building golang on MIPS using gccgo

2017-02-28 Thread James Cowgill
o resolve this. This is still a problem. It is currently not possible to build golang using gccgo on mips* due to it. What is the solution? Why can't (for instance) gccgo move to using the GOARCH values from golang? Thanks, James -- You received this message because you are subscribed to the Goog

[go-nuts] Notable Go 1.8 XML decoder bug fix

2017-02-16 Thread James Pettyjohn
I switched to go 1.8 today and found that some of my XML parsing was failing where it was passing in 1.6/1.7. After a bit of searching I found that there was a bug that was *fixed* in 1.8 and my faulty data was previously being ignored. Specifically empty attributes which mapped to non-nilable

Re: [go-nuts] Re: Handshake failed when using builtin TLS package: no cipher suite supported by both client and server

2017-02-08 Thread James Bardin
> вторник, 7 февраля 2017 г., 14:59:42 UTC+3 пользователь Alexandr Emelin > написал: > >> James, thanks for response. I am using go1.7.5 linux/amd64 >> >> I have no that client available too - it was originally seen in >> production logs, and now I rely only on SSL

[go-nuts] Re: Handshake failed when using builtin TLS package: no cipher suite supported by both client and server

2017-02-06 Thread James Bardin
What cipher quite is negotiated when you connect to the Heroku proxy? What version of Go are you using on the server, and are you using the default tls.Config? I don't have that client directly available to test with, but does your particular client show the expected information when you

Re: [go-nuts] Re: Dynamic select/channel causes data race

2017-02-02 Thread James Bardin
Can you point to the actual source you're using? The filenames and line numbers in the stack traces don't line up with the file you linked originally. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] Re: Dynamic select/channel causes data race

2017-02-02 Thread James Bardin
Can you post the actual output from the race detector? On Thursday, February 2, 2017 at 12:43:09 PM UTC-5, Aaron Wood wrote: > > Hi all, > > I'm seeing a very strange issue that I'm not quite sure how to fix: > > https://github.com/mesos/mesos-go/blob/next/backoff/backoff.go#L25 >

  1   2   >