Re: [go-nuts] Pass API key to google cloud vision api

2017-12-20 Thread Chris Broadfoot
Stack Overflow is the best place to ask questions for GCP. The documentation does describe how to authenticate to this API. If I recall correctly, API keys are not supported. On Dec 21, 2017 2:46 AM, "Sathish VJ" wrote: I'm trying to make an api call to google vision api using an api key from

[go-nuts] Pass API key to google cloud vision api

2017-12-20 Thread Sathish VJ
I'm trying to make an api call to google vision api using an api key from golang. But I'm getting a 400: bad request, invalid_grant error. What is the right way to make this call? import ( // ... "google.golang.org/api/option" vision "cloud.google.com/go/vision/apiv1" "golang.org/x/n

[go-nuts] forwarding http request and response

2017-12-20 Thread Lee Rick
hi, when http server receive a request A, create a new http request B with A, do B, get response respB, create a new http respA with respB how to do "create a new http request B with A" and " create a new http respA with respB" with io.copy method, and reset url,params, hosts etc.

Re: [go-nuts] How can I get unix timestamp(time.Now().Unix()) in linker(cmd/link)

2017-12-20 Thread Ian Lance Taylor
On Sun, Dec 17, 2017 at 7:11 PM, Ally Dale wrote: > > Thanks a lot, but I tried to pass timestamp by > "-X=runtime.buildtimestamp=" to linker, it fails with the same message. > I guess the timestamp makes the dependence packages always STALE, maybe I > have to check logic of command "go list"

[go-nuts] Golang and Http Request

2017-12-20 Thread muraliraja . muniraju
I wanted to understand the nature of the golang/http package for request and response as I am trying to write a proxy. For chunked / content-length encoding, http request and response are they completely assembled till the entire transaction is done and then shipped out . Example: if th

[go-nuts] Re: Use golang to call the win API

2017-12-20 Thread 流沙
Thanks 在 2017年12月16日星期六 UTC+8上午1:47:33,Jake Montgomery写道: > > I have not called a Windows API from go before, so there may be other > problems with your code. But looking at WlanEnumInterfaces documentation > > >

Re: [go-nuts] Re: [ANN] A blog post series on serving big satellite imagery with Go

2017-12-20 Thread Michael Jones
Certainly as you say, individual user patterns are not generally predictable. Sometimes aggregate patterns can be. The "sea of tiles" is the natural design and works great in normal cases. It seems the way to teach it in any case. Where the filesystem issue comes in would be, for example, the nomi

Re: [go-nuts] Re: select multiple expressions per case

2017-12-20 Thread Rob Pike
There is no particular reason, it was just to keep things simple, if it was even talked about. I don't think it was. If you want to propose a change, now is a good time to do that. Not sure the idea is above the bar, though. -rob On Thu, Dec 21, 2017 at 9:39 AM, wrote: > Tracker proposal fo

Re: [go-nuts] Re: [ANN] A blog post series on serving big satellite imagery with Go

2017-12-20 Thread Pablo Rozas Larraondo
Hi Michael, Thanks for your comments, I totally agree with them. File systems will struggle with the explosion of files resulting from the tile operation. As you point out, other formats, such as geoTIFF, HDF5 or NetCDF define the tiling or chunking process internally at the file level. The

[go-nuts] Re: select multiple expressions per case

2017-12-20 Thread matthewjuran
Tracker proposal for this: https://github.com/golang/go/issues/23196 Matt On Monday, December 18, 2017 at 10:11:02 AM UTC-6, matthe...@gmail.com wrote: > > I guess with select you can't do the comma for multiple cases having one > behavior like with switch: > > select{ > case <-c1, <-c2: // gof

[go-nuts] Re: play.golang.org going down (for a very short time) for maintenance

2017-12-20 Thread Andrew Bonventre
And we’re back up. Thanks all! On Wed, Dec 20, 2017 at 5:12 PM Andrew Bonventre wrote: > Thank you for your patience. It will be back up soon. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

[go-nuts] play.golang.org going down (for a very short time) for maintenance

2017-12-20 Thread Andrew Bonventre
Thank you for your patience. It will be back up soon. -- 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,

Re: [go-nuts] How to show reason, why code is slow.

2017-12-20 Thread Dave Cheney
Pprof does not capture that data, you may be better served with perf(1) on Linux. -- 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...@google

Re: [go-nuts] How to show reason, why code is slow.

2017-12-20 Thread Michael Monashev
Hi, Shawn. My question about deeper assembler level. How to see cache misses, branch misprediction and so on? -- Michael -- 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

Re: [go-nuts] How to show reason, why code is slow.

2017-12-20 Thread Shawn Milochik
If you're already looking at the pprof output, then you should be able to identify one of the following: * A function being called too many times * Consumption of an external resource (database, filesystem, etc.) in a loop * Failure to release memory (failing to close something) * Code that is act

[go-nuts] How to show reason, why code is slow.

2017-12-20 Thread Michael Monashev
Hi, golang-nuts. I profile Go code with pprof. I found slow place and try to understand why it`s slow. Too much calls or memory to slow or something more? How to understand it? -- Michael -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To uns

[go-nuts] Announcing gophersat, a SAT and Pseudo-Boolean solver, v1.0.0

2017-12-20 Thread Fabien
Dear fellow gophers, I'm happy to announce that gophersat, the SAT and pseudo-boolean solver written in Go by the Centre de Recherche en Informatique de Lens, now reached its first stable release (v1.0.0). It is available at https://github.com/crillab/gophersat and is released under the MIT li

[go-nuts] Re: static analysis tool for detecting unclosed io.Closer's

2017-12-20 Thread howardcshaw
In the absence of an affirmative, I'll just say that I did a search of my own. This site: https://github.com/mre/awesome-static-analysis lists a bunch of static analysis tools for go. https://github.com/alecthomas/gometalinter has another list, and will run them for you. They have binary packa

[go-nuts] Re: XML Pretty Print

2017-12-20 Thread howardcshaw
One thing to consider is what level of change to the file is acceptable? If it is just to be human read, than the suggestions already given may do what you want; but it you want to take that result and preserve it for future use, then the mxj and the encoding/xml based methods may produce unwant

[go-nuts] Re: Go Generate Vs Go Build!

2017-12-20 Thread howardcshaw
Go generate is not needed in your example. Go build is what is producing the hello executable. Go generate is used to run special commands specified by comments in the .go files - these commands could produce new .go files, package binaries into binhex or base64 encoded strings in .go files for

Re: [go-nuts] Re: newbie with go 1.9 troubles

2017-12-20 Thread Ian Lance Taylor
On Wed, Dec 20, 2017 at 3:41 AM, wrote: > > I have Fedora Linux 26 and I am trying to installed latest binary version > of go i.e go1.9.2.linux-amd64.tar.gz and there was no previous install on > the system and I have double checked with following command, and I have > installed go in my home d

Re: [go-nuts] GC Internals Questions

2017-12-20 Thread Ian Lance Taylor
On Wed, Dec 20, 2017 at 2:45 AM, Xuanyi Chew wrote: > > I'm guessing also, that a "true" pointer has to be byte aligned - no pointer > tagging shennanigans with unsafe.Pointer You can do all the pointer tagging you like as long as the final bits can not be interpreted as a pointer into the Go hea

Re: [go-nuts] GC Internals Questions

2017-12-20 Thread Ian Lance Taylor
On Wed, Dec 20, 2017 at 1:54 AM, Jan Mercl <0xj...@gmail.com> wrote: > > On Wed, Dec 20, 2017 at 12:57 AM 'Keith Randall' via golang-nuts > wrote: > >> Pointers that point from a Go object to somewhere outside the Go heap are >> perfectly fine. > > Can you please specify the exact mechanism used b

[go-nuts] Re: newbie with go 1.9 troubles

2017-12-20 Thread hbafna
sorry for earlier post issue resolved, somebody was overwriting at same location. On Thursday, August 31, 2017 at 4:17:37 AM UTC+5:30, rob wrote: > > Ubuntu 16.04 amd64 > > I d/l the tar.gz file and followed the instructions to install it to > /usr/local/go and set $PATH, $GOPATH, $GOBIN and $G

[go-nuts] Re: newbie with go 1.9 troubles

2017-12-20 Thread hbafna
Hey I have Fedora Linux 26 and I am trying to installed latest binary version of go i.e go1.9.2.linux-amd64.tar.gz and there was no previous install on the system and I have double checked with following command, and I have installed go in my home directory of test1 and have created a sample

[go-nuts] Re: bytes.Buffer Grow() doesn't always increase Cap()?

2017-12-20 Thread Paul Boyd
Ah.. ok. That makes sense. Grow() just ensures that some number of bytes can be written, and they could be, so it didn't do anything. Thanks for the explanation. On Wednesday, December 20, 2017 at 3:01:29 AM UTC-5, Uli Kunitz wrote: > > Grow ensures that there are at least n bytes to write.The c

Re: [go-nuts] bytes.Buffer Grow() doesn't always increase Cap()?

2017-12-20 Thread Paul Boyd
It happens with larger buffers too, though: https://play.golang.org/p/0pQq8eungQ On Tue, Dec 19, 2017 at 10:13 PM Ian Lance Taylor wrote: > On Tue, Dec 19, 2017 at 11:08 AM, Paul Boyd wrote: > > > > Sorry if this is a dumb question that's been answered before, but I can't > > find anything abou

Re: [go-nuts] GC Internals Questions

2017-12-20 Thread Xuanyi Chew
I'm guessing also, that a "true" pointer has to be byte aligned - no pointer tagging shennanigans with unsafe.Pointer On Wednesday, 20 December 2017 21:42:49 UTC+11, Xuanyi Chew wrote: > > I echo this. > > On Wednesday, 20 December 2017 20:55:03 UTC+11, Jan Mercl wrote: >> >> >> On Wed, Dec 20, 2

Re: [go-nuts] GC Internals Questions

2017-12-20 Thread Xuanyi Chew
I echo this. On Wednesday, 20 December 2017 20:55:03 UTC+11, Jan Mercl wrote: > > > On Wed, Dec 20, 2017 at 12:57 AM 'Keith Randall' via golang-nuts < > golan...@googlegroups.com > wrote: > > > Pointers that point from a Go object to somewhere outside the Go heap > are perfectly fine. > > Can you

[go-nuts] Profiling memory allocations for a function

2017-12-20 Thread snmed
Hi all I struggling with profiling memory allocation for a function. I start the test with: go test -run ^$ -bench Scanner -memprofile mem.out -cpuprofile cpu.out - memprofilerate=1Code hier eingeben... and then i use pprof with: go tool pprof log.test.exe mem.out --alloc_space top10 log\.\(\*

Re: [go-nuts] GC Internals Questions

2017-12-20 Thread Jan Mercl
On Wed, Dec 20, 2017 at 12:57 AM 'Keith Randall' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Pointers that point from a Go object to somewhere outside the Go heap are perfectly fine. Can you please specify the exact mechanism used by the runtime to determine "is outside the Go heap"?

[go-nuts] Re: bytes.Buffer Grow() doesn't always increase Cap()?

2017-12-20 Thread Uli Kunitz
Grow ensures that there are at least n bytes to write.The call to bb.Grow(2) in the example will not change the underlying byte slice, because there are already two bytes to write. A call to bb.Grow(initial+growth), which is bb.Grow(4) in the example, will enlarge the buffer to 8 bytes and will