[go-nuts] [ANN] go-resty v1.3 released - Simple HTTP and REST client library

2018-03-01 Thread Jeevanandam M.
Production Version : gopkg.in/resty.v1 Edge Version : github.com/go-resty/resty godoc : https://godoc.org/github.com/go-resty/resty Changelog: Enhancements: - Custom content type and data for multipart request PR #129 @Asker80 - Debug log with concatenated

[go-nuts] Cmd.Process.Start() on Windows have wrong Pid

2018-03-01 Thread Tamás Gulácsi
When I start "calc", I see "calc.exe" in the task list, NOT "calculator.exe". Maybe your "calc" starts "calculator.exe", and then exits? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

[go-nuts] Re: A go document layout problem

2018-03-01 Thread www4000
Is there way to flag this problem solved? Such as modify the title to (Solved) A go document layout problem but I don't find the modify button in this page >>> -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group

[go-nuts] Re: A go document layout problem

2018-03-01 Thread www4000
I'm in Windows 7 and Chrome latest version, I refresh page many times yesterday and still have problem, but it's strange that it works well today... I think this problem is solved now. On Friday, March 2, 2018 at 7:51:06 AM UTC+8, Krzysztof Kowalczyk wrote: > > Which browser are you using? >

[go-nuts] Re: Stripe API versioning scheme in Go

2018-03-01 Thread uriel
I had exactly the same question but for starter's, just that referenced blog post is not detailed enough (at least for me) to get a feel for what they're doing, so i can't even begin to think of a go version. On Thursday, January 25, 2018 at 7:20:44 AM UTC-6, Tiemo Kieft wrote: > > This

Re: [go-nuts] should the reflect docs explain what do the Data fields mean in SliceHeader and StringHeader?

2018-03-01 Thread David Collier-Brown
In the Multics tradition, I think you should say "Hic erit dracones" ("here there be dragons", in Latin (;-)) --dave On Thursday, March 1, 2018 at 1:19:03 PM UTC-5, Ian Lance Taylor wrote: > > The docs already say that the each type "cannot be used safely or > portably and its representation

[go-nuts] Re: A go document layout problem

2018-03-01 Thread Krzysztof Kowalczyk
Which browser are you using? I checked latest Chrome/Safari/Firefox on mac and they all work as expected. On Thursday, March 1, 2018 at 9:22:43 AM UTC-8, www4000 wrote: > > I find in https://golang.org/pkg/bytes/ > in the section *type Buffer*, > > the

[go-nuts] Cmd.Process.Start() on Windows have wrong Pid

2018-03-01 Thread Felian _
Hi. I faced a strange problem on Windows. Consider the following code: package main import ( "fmt" "os/exec" "regexp" "strconv" "strings" "time" ) func main() { // execute the calc cmd := exec.Command("calc") if err := cmd.Start(); err != nil {

[go-nuts] Gift wrap errors or not?

2018-03-01 Thread Tamás Gulácsi
I use github.com/pkg/errors. -- 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

Re: [go-nuts] Re: "file already closed" occurring on Linux only (possible bug?)

2018-03-01 Thread Mark Sheahan
Thanks looks like I have some fixing to do On Thu, Mar 1, 2018 at 3:45 PM, Tamás Gulácsi wrote: > golang.org/pkg/os/exec/#Cmd.StderrPipe > > "Wait will close the pipe after seeing the command exit, so ... it is > incorrect to call Wait before all reads from the pipe

[go-nuts] Re: "file already closed" occurring on Linux only (possible bug?)

2018-03-01 Thread Tamás Gulácsi
golang.org/pkg/os/exec/#Cmd.StderrPipe "Wait will close the pipe after seeing the command exit, so ... it is incorrect to call Wait before all reads from the pipe have completed." Put wg.Wait() of the read/writes from/to the pipes before calling sess.Wait(). (So it is not ok to call it in a

[go-nuts] Gift wrap errors or not?

2018-03-01 Thread Tad Vizbaras
It has been almost two years since this post: https://dave.cheney.net/2016/06/12/stack-traces-and-the-errors-package What is current best practice? Should I use some package to gift wrap errors in order to get stack trace attached to them? Standard library errors package is really "bare bones".

Re: [go-nuts] [Question]: Are there any plans to teach the compiler to emit VEX encoded instructions ?

2018-03-01 Thread Agniva De Sarker
Oops, spoke too soon. Got you now Ian. Thanks. On Mar 2, 2018 1:37 AM, "Agniva De Sarker" wrote: > We can still support all processors. I believe it should be possible to > check for cpuid flags and conditionally emit these instructions. > > On Mar 2, 2018 12:23

Re: [go-nuts] [Question]: Are there any plans to teach the compiler to emit VEX encoded instructions ?

2018-03-01 Thread Agniva De Sarker
We can still support all processors. I believe it should be possible to check for cpuid flags and conditionally emit these instructions. On Mar 2, 2018 12:23 AM, "Ian Lance Taylor" wrote: > On Thu, Mar 1, 2018 at 5:05 AM, Agniva De Sarker > wrote:

[go-nuts] "file already closed" occurring on Linux only (possible bug?)

2018-03-01 Thread Mark Sheahan
We've had an integration test that has very occasionally failed since go 1.8.x, which is that a pipe reader appears to be getting closed rather than just giving EOF when the writer is closed. An isolated test case is here in this repository: https://github.com/marksheahan/pipebug, just checkout

Re: [go-nuts] [Question]: Are there any plans to teach the compiler to emit VEX encoded instructions ?

2018-03-01 Thread Ian Lance Taylor
On Thu, Mar 1, 2018 at 5:05 AM, Agniva De Sarker wrote: > > I believe using the non-destructive 3 operand form will help a lot in > reducing the size of binaries. And also, it might give us a good base to add > FMA support and SIMD optimizations later. > > I have

Re: [go-nuts] should the reflect docs explain what do the Data fields mean in SliceHeader and StringHeader?

2018-03-01 Thread digg
On Thursday, March 1, 2018 at 1:19:03 PM UTC-5, Ian Lance Taylor wrote: > > On Thu, Mar 1, 2018 at 9:08 AM, > wrote: > > If not, it is hard to use them in meaningful ways. > > The docs already say that the each type "cannot be used safely or > portably and its

Re: [go-nuts] Re: When an object is KeepAlived, will other objects referenced by it also be KeepAlived?

2018-03-01 Thread digg
On Thursday, March 1, 2018 at 1:16:45 PM UTC-5, Ian Lance Taylor wrote: > > On Thu, Mar 1, 2018 at 9:04 AM, > wrote: > > > > Is the KeepAlive call in the following example essential? and > sufficient? > > > > func ByteSlice2String(bs []byte) (str string) { > >

Re: [go-nuts] should the reflect docs explain what do the Data fields mean in SliceHeader and StringHeader?

2018-03-01 Thread Ian Lance Taylor
On Thu, Mar 1, 2018 at 9:08 AM, wrote: > If not, it is hard to use them in meaningful ways. The docs already say that the each type "cannot be used safely or portably and its representation may change in a later release." I don't think we need to say anything else. Ian --

Re: [go-nuts] Re: When an object is KeepAlived, will other objects referenced by it also be KeepAlived?

2018-03-01 Thread Ian Lance Taylor
On Thu, Mar 1, 2018 at 9:04 AM, wrote: > > Is the KeepAlive call in the following example essential? and sufficient? > > func ByteSlice2String(bs []byte) (str string) { > sliceHdr := (*reflect.SliceHeader)(unsafe.Pointer()) > strHdr :=

Re: [go-nuts] When an object is KeepAlived, will other objects referenced by it also be KeepAlived?

2018-03-01 Thread Ian Lance Taylor
On Thu, Mar 1, 2018 at 8:29 AM, wrote: > > For example, > > func f(s []byte) { > > // Will the the KeepAlive call make sure the underlying bytes > // of s will not garbage collected for sure? > > runtime.KeepAlive() > } Yes, this will ensure that the bytes in s

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

2018-03-01 Thread Ian Lance Taylor
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 measurements. > > But...calling time.Now() appears to have a lot of overhead.

Re: [go-nuts] copy is not very essential function? It can always be simulated by append?

2018-03-01 Thread digg
On Thursday, March 1, 2018 at 12:46:13 PM UTC-5, Axel Wagner wrote: > > There is another significant difference > between append and copy, which is > that copy only copies the minimum number of elements in either slice. So, > if you want to simulate

Re: [go-nuts] Go list returning directory starting with underscore on Ubuntu

2018-03-01 Thread Sebastien Binet
Hi Michel, I believe this is because you ran 'go list' from a directory outside of $GOPATH. -s sent from my droid On Mar 1, 2018 6:22 PM, "Michel Hollands" wrote: > Hello, > > When running go list on Ubuntu the results are weird: > >

Re: [go-nuts] copy is not very essential function? It can always be simulated by append?

2018-03-01 Thread 'Axel Wagner' via golang-nuts
There is another significant difference between append and copy, which is that copy only copies the minimum number of elements in either slice. So, if you want to simulate copy via append, you'd need to at least throw a couple of if's in there. Of course,

[go-nuts] Go list returning directory starting with underscore on Ubuntu

2018-03-01 Thread Michel Hollands
Hello, When running go list on Ubuntu the results are weird: michel@michel-VirtualBox:~/git/grpcurl$ go list . _/home/michel/git/grpcurl michel@michel-VirtualBox:~/git/grpcurl$ Running the same on the Mac returns just grpcurl, which is the correct package. The Go version is: go version

[go-nuts] A go document layout problem

2018-03-01 Thread www4000
I find in https://golang.org/pkg/bytes/ in the section *type Buffer*, the *Example Reader* cannot expand completely, as in the screenshot, can this issue be opened on https://github.com/golang/go/issues ?

[go-nuts] should the reflect docs explain what do the Data fields mean in SliceHeader and StringHeader?

2018-03-01 Thread digg
If not, it is hard to use them in meaningful ways. -- 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,

[go-nuts] Re: When an object is KeepAlived, will other objects referenced by it also be KeepAlived?

2018-03-01 Thread digg
Is the KeepAlive call in the following example essential? and sufficient? func ByteSlice2String(bs []byte) (str string) { sliceHdr := (*reflect.SliceHeader)(unsafe.Pointer()) strHdr := (*reflect.StringHeader)(unsafe.Pointer()) strHdr.Len = sliceHdr.Len strHdr.Data = sliceHdr.Data

Re: [go-nuts] copy is not very essential function? It can always be simulated by append?

2018-03-01 Thread digg
On Thursday, March 1, 2018 at 11:50:53 AM UTC-5, andrey mirtchovski wrote: > > > I don't know that. append was not in Go 1.0? > > Go the language was opened to the world on Nov 10, 2009. Go 1.0 was > released 28 March 2012. > > Append appeared on Oct 27, 2010: > >

[go-nuts] High precision timer data?

2018-03-01 Thread James Chacon
I know the time package includes support for using the cycle timer on the machine (if available) to get high precision monotonic time measurements. But...calling time.Now() appears to have a lot of overhead. Measuring the delay between 2 consecutive calls gives me anywhere from 150ns to 900+ns

Re: [go-nuts] copy is not very essential function? It can always be simulated by append?

2018-03-01 Thread andrey mirtchovski
> I don't know that. append was not in Go 1.0? Go the language was opened to the world on Nov 10, 2009. Go 1.0 was released 28 March 2012. Append appeared on Oct 27, 2010: https://github.com/golang/go/commit/d8b5d039cd1bec151cc325973ff32bd34ebb0456 -- You received this message because you are

Re: [go-nuts] copy is not very essential function? It can always be simulated by append?

2018-03-01 Thread digg
On Thursday, March 1, 2018 at 11:26:02 AM UTC-5, Jan Mercl wrote: > > > On Thu, Mar 1, 2018 at 5:13 PM wrote: > > > _ = append(b[1:1], b[:len(b)-1]...) > > Bad reading, my fault. > > Anyway, I think it should now be clear that append depends on the > 'inteligence' of copy

[go-nuts] When an object is KeepAlived, will other objects referenced by it also be KeepAlived?

2018-03-01 Thread digg
For example, func f(s []byte) { // Will the the KeepAlive call make sure the underlying bytes // of s will not garbage collected for sure? runtime.KeepAlive() } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] copy is not very essential function? It can always be simulated by append?

2018-03-01 Thread Jan Mercl
On Thu, Mar 1, 2018 at 5:13 PM wrote: > _ = append(b[1:1], b[:len(b)-1]...) Bad reading, my fault. Anyway, I think it should now be clear that append depends on the 'inteligence' of copy as it knows when to move things around from the beginning and when to start from the

Re: [go-nuts] copy is not very essential function? It can always be simulated by append?

2018-03-01 Thread digg
yes On Thursday, March 1, 2018 at 11:14:24 AM UTC-5, Val wrote: > > Jan, I think OP meant https://play.golang.org/p/_fuSb34q_ex -- 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,

Re: [go-nuts] copy is not very essential function? It can always be simulated by append?

2018-03-01 Thread Val
Jan, I think OP meant https://play.golang.org/p/_fuSb34q_ex -- 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

Re: [go-nuts] copy is not very essential function? It can always be simulated by append?

2018-03-01 Thread digg
On Thursday, March 1, 2018 at 11:08:09 AM UTC-5, Jan Mercl wrote: > > On Thu, Mar 1, 2018 at 4:50 PM wrote: > > > copy(a[1:], a) is equivalent to _ = append(s[1:1], s[:len(s)-1]...) > > https://play.golang.org/p/uiz2ANSxjbA > > If b = append(b[1:1], b[:len(b)-1]...) is

Re: [go-nuts] copy is not very essential function? It can always be simulated by append?

2018-03-01 Thread Jan Mercl
On Thu, Mar 1, 2018 at 4:50 PM wrote: > copy(a[1:], a) is equivalent to _ = append(s[1:1], s[:len(s)-1]...) https://play.golang.org/p/uiz2ANSxjbA -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] copy is not very essential function? It can always be simulated by append?

2018-03-01 Thread digg
On Thursday, March 1, 2018 at 10:38:20 AM UTC-5, Jan Mercl wrote: > > On Thu, Mar 1, 2018 at 4:28 PM wrote: > > > is the statement right? > > It depends on the POV. I see copy as more fundamental than append. It's > easy to write append using copy, not exactly trivial the

Re: [go-nuts] copy is not very essential function? It can always be simulated by append?

2018-03-01 Thread Jan Mercl
On Thu, Mar 1, 2018 at 4:28 PM wrote: > is the statement right? It depends on the POV. I see copy as more fundamental than append. It's easy to write append using copy, not exactly trivial the other way around. Consider cases like copy(a[], a[1:]) or copy(a[1:], a). -- -j

[go-nuts] copy is not very essential function? It can always be simulated by append?

2018-03-01 Thread digg
is the statement right? -- 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] Assembling assembly: An Academic Affair

2018-03-01 Thread Xuanyi Chew
Hello, I'm no stranger to writing assembly in Go (that is, the Plan9 assembly). I know how to make them work, for the most part. My questions are these: 1. Assuming I have a program written entirely in Go. I use go tool compile -S to output the assembly. It's then manually cleaned up

[go-nuts] [Question]: Are there any plans to teach the compiler to emit VEX encoded instructions ?

2018-03-01 Thread Agniva De Sarker
Hi, I believe using the non-destructive 3 operand form will help a lot in reducing the size of binaries. And also, it might give us a good base to add FMA support and SIMD optimizations later. I have been adding fast paths to some math functions to use AVX instructions, but I was just