[go-nuts] Re: photoslibrary/v1 no longer available

2024-07-31 Thread James Hawkins
symptom to your issue. Also searching pkg.go.dev there are other packages you could use https://pkg.go.dev/github.com/mathieubrun/go-google-photos-api/photoslibrary/v1 Regards, James On Wednesday 31 July 2024 at 15:05:10 UTC+2 Pratik Tamgole wrote: > Hi, > > I'm trying to use

[go-nuts] Re: how to start with go?

2024-07-23 Thread James Hawkins
Hi Kowsik, This is a time old statement from many new people to software not just golang. I think to rather brush your experience with a broad stroke you should focus on one thing. Maybe start here https://quii.gitbook.io/learn-go-with-tests TDD has some nice guard rails which will give

Re: [go-nuts] Surprising behaviour in x/time/rate

2024-07-22 Thread 'James Lees' via golang-nuts
Small update: I created #68541 <https://github.com/golang/go/issues/68541> to track this. On Friday 19 July 2024 at 22:52:50 UTC+1 Ian Lance Taylor wrote: > On Fri, Jul 19, 2024 at 1:52 PM 'James Lees' via golang-nuts > wrote: > > > > Hi there, > > I&#

[go-nuts] Surprising behaviour in x/time/rate

2024-07-19 Thread &#x27;James Lees' via golang-nuts
aven't thought about that too deeply. I'm happy to propose a change/create an issue but hopefully you folks can help me understand whether I'm missing something obvious! Thanks James -- -- *This email is confidential and protected by copyright, and might contain privileged

[go-nuts] Re: memory issues

2023-02-09 Thread James Dornan
all as 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 pro

[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 in

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 &data[0] as per https://pkg.go.dev/cmd/cgo So maybe something like this: p.privateKey = *((*C.private

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

2022-07-23 Thread James Brooke
On Saturday, 23 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 dependenc

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

2022-07-22 Thread James Brooke
g-config" GOGCCFLAGS="-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

[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/pkg/mod/google.golan

[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 := modu

[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
ime.Second, } go func() { panic(http.ListenAndServe(getHTTPPort(), m.HTTPHandler(nil))) }() panic(s.ListenAndServeTLS("", "")) Thanks, -James -- You received this message because you are subscribe

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
are subscribed to a 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+unsub

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 a

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

2021-03-07 Thread James Lawrence
his discussion on the web visit > https://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&am

[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

[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 in

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. > > fu

[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 w

[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
argue 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

[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 fp=0xc58e

[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
efore running 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. >&

Re: [go-nuts] Parsing go.mod

2019-09-03 Thread James Pettyjohn
times, 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

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 message

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

2019-05-30 Thread James Hartig
ounds like you've got 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 >> imp

[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 lates

[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 k

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 184467440

[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 https://groups.google

[go-nuts] Re: Local cache of dependencies

2018-08-23 Thread James Warren
on. 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 >

[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 in

[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

[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 wrote: > Hello, > > have you considered using time.NewTicker > <https://golang.org/p

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,

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

2018-03-03 Thread James Chacon
On Thu, Mar 1, 2018 at 11:59 PM, James Chacon wrote: > > > On Thu, Mar 1, 2018 at 11:07 PM, James Chacon > wrote: > >> >> >> On Thu, Mar 1, 2018 at 10:13 AM, Ian Lance Taylor >> wrote: >> >>> On Thu, Mar 1, 2018 at 8:56 AM, James Chacon &

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

2018-03-02 Thread James Chacon
On Thu, Mar 1, 2018 at 11:07 PM, James Chacon wrote: > > > On Thu, Mar 1, 2018 at 10:13 AM, Ian Lance Taylor wrote: > >> On Thu, Mar 1, 2018 at 8:56 AM, James Chacon >> wrote: >> > >> > I know the time package includes support for using the cycle time

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

2018-03-01 Thread James Chacon
On Thu, Mar 1, 2018 at 10:13 AM, Ian Lance Taylor wrote: > On Thu, Mar 1, 2018 at 8:56 AM, James Chacon > wrote: > > > > I know the time package includes support for using the cycle timer on the > > machine (if available) to get high precision monotonic time measurement

[go-nuts] High precision timer data?

2018-03-01 Thread James Chacon
and use that as a baseline 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 f

[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 fr

[go-nuts] Go as your first language

2018-01-15 Thread James Pettyjohn
on the subject often expects 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 t

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 wrote: > 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 a

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). > > > > I get a SIGSEGV during test run: >

[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 i

[go-nuts] Re: What does the 1st :8 do in -- slice := (*[1 <<

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(&i))[:8:8] >> >> The fist 8 is the length, and the second is capacity. See "Full Slice Expressions" specification here: https://

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 contract for > MarshalText/Un

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 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 other than UDP is expecting

[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 s

[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 size

[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 the

[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. Us

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. h

Re: [go-nuts] go env GOPATH not reflecting $GOPATH

2017-08-31 Thread James Bardin
On Thursday, August 31, 2017 at 9:46:11 PM UTC-4, burpswangy wrote: > > Wow, actually... that did work. I was using 'set GOPATH' and not 'export > GOPATH'. I have GOPATH defined in my /etc/bash.bashrc... is there anywhere > else I should be putting it? > >> >>> You should be using a profile f

[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 golang.org/x/net/i

[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` co

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 to wait for the reply of

[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). > > On

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 > wrote: > > I just updated my dependency on golang.org/x/text and

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 > wrote: > > > > Labels for clarity: > > > > 1. goroutine 1 spawns goroutine 2 to read from Oregon, and spawns > goroutine > > 3

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, > > wrote: > > > > On Wednesday, 12 July 2017 04:44:43 UTC+1, Ian Lance Taylor wrote: > >> > >> On Tue, Jul 11, 2017 at 12:27 PM, wrote: > >> > > >> > This caught me out recently; th

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, > > wrote: > > > > 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

[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 Orego

[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 prett

[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, Ju

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

2017-06-15 Thread James Pettyjohn
t internal 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

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

2017-06-14 Thread James Pettyjohn
on can handle 10s of thousands with ease. This brought the lookups down by about 50%: BenchmarkLookupLooseLazy-8 300 458 ns/op 32 B/op 1 allocs/op BenchmarkLookupLooseMap-8 500 265 ns/op 0 B/op 0 allocs/op Let me know if see anything else worth adjusting. Best, James On Wednesday, June

[go-nuts] KVs store for large strings

2017-06-14 Thread James Pettyjohn
dary concern 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 un

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

2017-06-12 Thread James Pettyjohn
ant binary to 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

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

2017-06-11 Thread James Pettyjohn
sion: 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

[go-nuts] Go install speedup within docker

2017-06-10 Thread James Pettyjohn
e I run a new docker container, same 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 Googl

[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

[go-nuts] In-memory secondary index

2017-06-05 Thread James Pettyjohn
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 get those where certain fields have certain values. Are there are any native go libraries which do this kind of sort of "secondary

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

2017-05-17 Thread James Hartig
d when the handshake 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: > cli

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 error

Re: [go-nuts] Overriding cgo version

2017-04-27 Thread James Pettyjohn
Ya, it's noted in there it was for tests only. I think that should be a part of the build env, not the source. I've rolled back for now. 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 Pett

[go-nuts] Overriding cgo version

2017-04-26 Thread James Pettyjohn
as it brings in icu 58. This appears to be caused by https://github.com/golang/text/blob/master/cases/icu.go#L16 . Is there a way to override this at compilation time? Best, James -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsub

[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" grou

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

2017-04-05 Thread James McHugh
to tie 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 "go

[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" > > G

[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, > someho

[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 the

[go-nuts] Re: Project architecture

2017-03-12 Thread James Pettyjohn
ipe for heartache. > > 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 t

[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 th

[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 a

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 > . > Hav

  1   2   >