[go-nuts] Re: Creating shared-libraries which override existing system functions?

2017-05-09 Thread Donovan
make the return type in your go program C.int and it'll compile. then using LD_PRELOAD against the so should work. On Monday, May 8, 2017 at 5:44:09 PM UTC-4, Tony Walker wrote: > > Hi All, > > I'd like to experiment writing a shared library that will override system > functions via LD_LIBRARY_P

Re: [go-nuts] unexpected numerical behavior in float64 conversions

2017-05-09 Thread Ian Lance Taylor
On Tue, May 9, 2017 at 2:10 PM, Ed Vielmetti wrote: > > Consider the following code snippet, at https://play.golang.org/p/hUUF9O-p-k > > Using go 1.8.1 (same thing with current master branch) > > package main > func main() { > x := float64(-1) > println(uint64(x)) > println

[go-nuts] unexpected numerical behavior in float64 conversions

2017-05-09 Thread Ed Vielmetti
Consider the following code snippet, at https://play.golang.org/p/hUUF9O-p-k Using go 1.8.1 (same thing with current master branch) package main func main() { x := float64(-1) println(uint64(x)) println(int64(x)) println(uint64(int64(x))) } On ARM64: 0 -1 18446744

[go-nuts] Re: Delve v1.0.0-rc.1 release

2017-05-09 Thread Derek Parker
Really glad that it's been a useful tool for you, always great to hear! On Tuesday, May 9, 2017 at 12:04:23 PM UTC-7, JuciÊ Andrade wrote: > > Derek, I want to say a big "thank you" to you and all people involved in > this project. > > Delve became an indispensible tool for me. I feel much safer

[go-nuts] Re: Delve v1.0.0-rc.1 release

2017-05-09 Thread Derek Parker
Really glad to hear it's been a useful tool for you, always great to hear! On Tuesday, May 9, 2017 at 12:04:23 PM UTC-7, JuciÊ Andrade wrote: > > Derek, I want to say a big "thank you" to you and all people involved in > this project. > > Delve became an indispensible tool for me. I feel much sa

[go-nuts] Re: Delve v1.0.0-rc.1 release

2017-05-09 Thread ojucie
Derek, I want to say a big "thank you" to you and all people involved in this project. Delve became an indispensible tool for me. I feel much safer after executing new code step by step, and I am sure I am not alone. I owe you one, guys. -- You received this message because you are subscribed

Re: [go-nuts] why received can be defined with/without pointer?

2017-05-09 Thread Volker Dobler
I must admit you lost me. Thus just some minor notes: On Tuesday, 9 May 2017 16:05:16 UTC+2, mhh...@gmail.com wrote: > > > Help me to not copy a pointer value when its inappropriate. > Copying a pointer value is one of the most trivial and fast operations imaginable. Maybe you are using the term

[go-nuts] encoding/asn1: Accept the non-PrintableString character underscore

2017-05-09 Thread Ivan Borshukov
Hi Gohpers, I need to deal with certificates which contain '_'. Unfortunately, the '_' is not treated like a printable string character from Go. I read through the discussions in [1], [2], but unfortunately none of them proposes a work around. Can you suggest a solution other than forking the x

Re: [go-nuts] Re: Do I need to unset variables in a for loop?

2017-05-09 Thread Ian Davis
On Tue, 9 May 2017, at 05:07 PM, Jesper Louis Andersen wrote: >> >> I don't believe this is helpful to the questioner who was simply >> explaining their understanding.>> > > A reference to cargo cults is useful insofar one should study why > something happens rather than copying a hearsay. On th

Re: [go-nuts] Re: Do I need to unset variables in a for loop?

2017-05-09 Thread Jesper Louis Andersen
> > > I don't believe this is helpful to the questioner who was simply > explaining their understanding. > > A reference to cargo cults is useful insofar one should study why something happens rather than copying a hearsay. On the other hand, it doesn't give you much tooling: you can't solve the pr

Re: [go-nuts] Re: Do I need to unset variables in a for loop?

2017-05-09 Thread Ian Davis
On Tue, 9 May 2017, at 04:31 PM, Pierre Durand wrote: >> I "believe" in PHP a for loop keeps the variable in memory until the >> end of the script and if you want to remove the variable from memory >> you need to unset the variable to help conserve memory.> > https://en.wikipedia.org/wiki/Cargo_cu

[go-nuts] Re: Do I need to unset variables in a for loop?

2017-05-09 Thread Pierre Durand
> > I "believe" in PHP a for loop keeps the variable in memory until the end > of the script and if you want to remove the variable from memory you need > to unset the variable to help conserve memory. https://en.wikipedia.org/wiki/Cargo_cult Le mardi 9 mai 2017 00:29:14 UTC+2, var...@gmail.

[go-nuts] Re: TAR max file name woes

2017-05-09 Thread Jim Robinson
It looks to me as though the Writer specifically only handles the posix standard tar, which does indeed limit you to 100 characters. It appears as though they've implemented support for reading the GNU format, which I think does not place limits on the name length. See https://github.com/gola

Re: [go-nuts] Re: adding context.Context to new code

2017-05-09 Thread mhhcbon
> I've done a limited form of this using awk ;-) if you have a minute, can you tell more about what limited you in your attempts and which trade made you stop (guessing), if any ? Do you still think it be awesome ? Or have you made your mind to an opposite position ? if so, For which reasons

[go-nuts] TAR max file name woes

2017-05-09 Thread blakrow
I am attempting to TAR a directory with relatively long file names (over 100 chars long) and all I get is garbage. Is there any way to TAR a directory with file paths longer than 100 chars? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To uns

Re: [go-nuts] Re: adding context.Context to new code

2017-05-09 Thread Sameer Ajmani
The eg tool can execute simple refactoring steps, but automating context plumbing through a chain of calls is an open problem. Alan Donovan put some thought into this a few years ago, and I've done a limited form of this using awk ;-) On Tue, May 9, 2017 at 6:10 AM wrote: > I want something simi

Re: [go-nuts] Re: use of builtin print for debug

2017-05-09 Thread mhhcbon
On Tuesday, May 9, 2017 at 2:46:03 PM UTC+2, Marvin Renich wrote: > > [I set an explicit Reply-To header because I do not want duplicate > emails. Please do not CC me; I read this list.] > sure. > > * mhh...@gmail.com > [170509 > 07:40]: > > : ( thanks > > > > $ man gofmt > > Aucune

Re: [go-nuts] why received can be defined with/without pointer?

2017-05-09 Thread mhhcbon
On Tuesday, May 9, 2017 at 2:21:52 PM UTC+2, Volker Dobler wrote: > > On Tuesday, 9 May 2017 12:30:38 UTC+2, mhh...@gmail.com wrote: >> >> in short and put straightly, >> 1- i think its not appropriate to let us >> define pointer/non pointer attribute >> of a type over multiple points in the co

[go-nuts] Re: Creating shared-libraries which override existing system functions?

2017-05-09 Thread tonywalker . uk
Looks like the first link didn't work. Should link to here . -- You received this message because you are subscribed to the Google Groups "golang-nuts" group

Re: [go-nuts] Re: use of builtin print for debug

2017-05-09 Thread Marvin Renich
[I set an explicit Reply-To header because I do not want duplicate emails. Please do not CC me; I read this list.] * mhhc...@gmail.com [170509 07:40]: > : ( thanks > > $ man gofmt > Aucune entrée de manuel pour gofmt > /no such entry/ One of many advantages of the Debian distribution is that p

Re: [go-nuts] why received can be defined with/without pointer?

2017-05-09 Thread Jan Mercl
On Tue, May 9, 2017 at 2:22 PM Volker Dobler wrote: > Go offers two types of methods, those > defined on value types and those defined on pointer types. To avoid possible confusion: It's not possible to attach methods to a pointer type. The receiver has form T or *T, but T cannot be a pointer ty

Re: [go-nuts] why received can be defined with/without pointer?

2017-05-09 Thread Volker Dobler
On Tuesday, 9 May 2017 12:30:38 UTC+2, mhh...@gmail.com wrote: > > in short and put straightly, > 1- i think its not appropriate to let us > define pointer/non pointer attribute > of a type over multiple points in the code. > In my experience of a beginner, its a pain that teaches you to always u

Re: [go-nuts] Re: use of builtin print for debug

2017-05-09 Thread mhhcbon
: ( thanks $ man gofmt Aucune entrée de manuel pour gofmt /no such entry/ *$ gofmt -husage: gofmt [flags] [path ...] -r stringrewrite rule (e.g., 'a[b:len(a)] -> a[b:]')* https://golang.org/cmd/gofmt/#hdr-Examples How to take advantage of it ? He needs to add new func, probably. A

Re: [go-nuts] Re: suggest: improve go gen intergration for non core code ?

2017-05-09 Thread mhhcbon
thanks for feedback, i put that in regards to my understanding of go generate, re run it anytime its needed, anytime you changed your code, please see https://groups.google.com/forum/#!topic/golang-nuts/8L_bjxB-_T0 that concretely demonstrates why i don t go with the "usual thinking". On Tuesda

Re: [go-nuts] Re: use of builtin print for debug

2017-05-09 Thread Marvin Renich
* mhhc...@gmail.com [170509 07:10]: > Also i think go has already several patchers that you might get > inspiration from, not sure where they are located. Sorry : x Try man gofmt and look at -r. ...Marvin -- You received this message because you are subscribed to the Google Groups "golang-nut

Re: [go-nuts] Re: suggest: improve go gen intergration for non core code ?

2017-05-09 Thread Ian Davis
On Tue, 9 May 2017, at 12:12 PM, mhhc...@gmail.com wrote: > Maybe that could be a simple go sub command: > > go gun [...packages] > > gen+run=>gun > > Sure i could do on my end, it won t be adopted so ... useless. Usually go generate is intended to be run once and the results committed to th

[go-nuts] Re: suggest: improve go gen intergration for non core code ?

2017-05-09 Thread mhhcbon
Maybe that could be a simple go sub command: go gun [...packages] gen+run=>gun Sure i could do on my end, it won t be adopted so ... useless. On Friday, May 5, 2017 at 3:15:25 PM UTC+2, mhh...@gmail.com wrote: > > Hi, > > just a suggestion to improve go gen adoption rate, maybe. > > go genera

[go-nuts] Re: use of builtin print for debug

2017-05-09 Thread mhhcbon
ast transformation seems a good candidate for your problem. Should not be very difficult. start with https://godoc.org/golang.org/x/tools/go/loader Learn ast struct with https://golang.org/pkg/go/ast/#Print might be helpful https://gist.github.com/mh-cbon/3ed5d9c39e9635cfed0f89698133 Als

[go-nuts] Re: [ANN] listser/mutexer/channeler: generators.

2017-05-09 Thread mhhcbon
Hi, i want to share some more with you as i feel like it looks good to whoever interested into speeding up his programming experience with go ;) Until now i presented works that took a type T and produce a derived type T2 of it. Easy stuff, not so useful unless you only want to do rpc stuffs. B

[go-nuts] Re: Go 1.8.1 is released

2017-05-09 Thread nixusr
Great!!! On Friday, April 7, 2017 at 3:16:40 PM UTC-3, Nathan Kerr wrote: > > Thanks for all the hard work! > > I have updated my go release timeline > visualization. > -- You received this message because you are subscribed to the Google

Re: [go-nuts] why received can be defined with/without pointer?

2017-05-09 Thread mhhcbon
thanks, > The definition of the method always makes it clear whether you are passing a value of the type or a pointer to the type. People defining methods on large types should know which one want to use. in short and put straightly, 1- i think its not appropriate to let us define pointer/n

[go-nuts] Re: adding context.Context to new code

2017-05-09 Thread mhhcbon
I want something similar too. Automatic and smart insertion of context args in a chain of calls. Methods signature updates are easy, but how to appropriately insert context check in the ast ? I m not sure yet. >The difficulty here seems to differentiate intra package calls from calls to stand