[go-nuts] How to use cflag -flto?

2018-02-19 Thread alex . rou . sg
So I'm trying to compile a test program with the cflag -flto and it failed to build with the message: > > cannot load DWARF output from $WORK/b001//_cgo_.o: decoding dwarf section > info at offset 0x0: too short I feel like I'm doing something wrong so I posed here instead of on github. Even t

Re: [go-nuts] Client certificate in request missing

2018-02-19 Thread Miha Zoubek
Hello i tried this certificates also with Nodejs and there it is working on first try, so certificates should be ok. Only difference is that i did not includ

Re: [go-nuts] Client certificate in request missing

2018-02-19 Thread Miha Zoubek
Here is screen shot. I tried the same certificates with NodeJs and there is working on first shot, but really do not want to use NodeJs for this :) I Dne

Re: [go-nuts] Re: import paths - slash vs backslash

2018-02-19 Thread Ian Lance Taylor
On Mon, Feb 19, 2018 at 9:15 PM, 'Tim Hockin' via golang-nuts wrote: > Pinging this topic - does anyone know? > > On Fri, Nov 10, 2017 at 10:30 AM, Tim Hockin wrote: >> Is it valid to say `import "github.com\foo\bar" (windows path >> separators) or must it be "github.com/foo/bar"? I couldn't fin

[go-nuts] Re: import paths - slash vs backslash

2018-02-19 Thread 'Tim Hockin' via golang-nuts
Pinging this topic - does anyone know? On Fri, Nov 10, 2017 at 10:30 AM, Tim Hockin wrote: > Is it valid to say `import "github.com\foo\bar" (windows path > separators) or must it be "github.com/foo/bar"? I couldn't find a > canonical answer to this. > > Thanks > > Tim -- You received this mes

[go-nuts] Re: Dero: CryptoNote protocol + smart contracts using golang

2018-02-19 Thread 867cryptocurrency
Hi Matt, Thank you very much for taking the time to contribute your suggestions. I've forwarded them to the development team and they also asked me to express their thanks. A lot of the dead code, redundancies, and other items that have been mentioned are there to keep things as simple as possi

Re: [go-nuts] Appropriate Go type for cgo void* param that accepts either an offset or pointer?

2018-02-19 Thread Eric Woroshow
That makes sense. The upstream API implication, then, would be both GoGlDrawElements(..., unsafe.Pointer) & GoGlDrawElementsWithOffset(..., unitptr) are necessary; that is, there can be no 1:1 Go mapping of the C API. There is an argument to be made that the more explicit Go API is better anyhow.

Re: [go-nuts] Appropriate Go type for cgo void* param that accepts either an offset or pointer?

2018-02-19 Thread Ian Lance Taylor
On Mon, Feb 19, 2018 at 3:09 PM, Eric Woroshow wrote: > > Right, declaring the type as uintptr but requiring that the memory come from > C.malloc is workable, but definitely compromises ease-of-use. Typically the > pointer values are to data stored in slices, and per issue 13656 there does > not (

Re: [go-nuts] Re: Any plans to add ASN.1 PER support?

2018-02-19 Thread andrey mirtchovski
didn't reply to list, sorry: > https://github.com/chemikadze/asn1go i gave it a try. it's a good start (we use asn1c heavily, asn1go is a good match for our use case) but there seems to be a lot missing. including a license. i created an issue for that. it failed to parse our asn.1 on some techn

Re: [go-nuts] json encoding & decoding interface types

2018-02-19 Thread Krzysztof Kowalczyk
The core issue seems to be that that round-tripping via json looses information i.e. type of serialized record. You solved it by embedding type as field of the record, which works. You could embed type implicitly. One way to do it is to use a separate file for each type. The type is implicitly

Re: [go-nuts] json encoding & decoding interface types

2018-02-19 Thread Doğan Kurt
Hi Burak, The example objects are very simplified. In real code, there are many more object types and some of them looks exactly same. For instance; type chromeHomepage struct { Url string File string } type firefoxHomepage struct { Url string File string } They look exactly same in the json

Re: [go-nuts] json encoding & decoding interface types

2018-02-19 Thread Burak Serdar
On Mon, Feb 19, 2018 at 4:45 PM, Doğan Kurt wrote: > Hi great Go community. Sorry it's a long question, but i would really > appreciate some guidance. > > > > > > Let's say i have two different objects, browser and executable that > implement ScanCleaner interface. > > type Sc

[go-nuts] json encoding & decoding interface types

2018-02-19 Thread Doğan Kurt
Hi great Go community. Sorry it's a long question, but i would really appreciate some guidance. Let's say i have two different objects, browser and executable that implement ScanCleaner interface. type ScanCleaner interface { scan() clean() } type browser struct { Name

Re: [go-nuts] Appropriate Go type for cgo void* param that accepts either an offset or pointer?

2018-02-19 Thread Eric Woroshow
Right, declaring the type as uintptr but requiring that the memory come from C.malloc is workable, but definitely compromises ease-of-use. Typically the pointer values are to data stored in slices, and per issue 13656 there does not (yet) exist a good

Re: [go-nuts] Re: Tweaking sync.Pool for mostly-empty pools

2018-02-19 Thread Ian Lance Taylor
On Mon, Feb 19, 2018 at 4:56 AM, Chris Hopkins wrote: > > I would have expected the compiler to allowed to change: > if len(l.shared) > 0 { # the racy check for non-emptiness > l.Lock() > last := len(l.shared) - 1 > to > tmp := len(l.shared) > if tmp > 0 { # the racy check for non-emptiness >

Re: [go-nuts] Client certificate in request missing

2018-02-19 Thread Maciej Gałkowski
Ah, just had a closer look at the screenshot. It seems that the server sends Certificate Request message. The Certificate Request contains a list of all CA RDNs that are accepted by the server, (which can be an empty list, in which case cert signed by CA should be accepted). It would be easier

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Henrik Johansson
Well, first I'll have a look at it's magic 😀 On Mon, Feb 19, 2018, 22:06 Rob Pike wrote: > You could say > > export GOCACHE=off > > in your bashrc to disable the cache permanently. > > -rob > > > On Tue, Feb 20, 2018 at 8:00 AM, Henrik Johansson > wrote: > >> Ok, good to know. Thanks! > > >> >>

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Rob Pike
You could say export GOCACHE=off in your bashrc to disable the cache permanently. -rob On Tue, Feb 20, 2018 at 8:00 AM, Henrik Johansson wrote: > Ok, good to know. Thanks! > > > On Mon, Feb 19, 2018, 21:49 Ian Lance Taylor wrote: > >> On Mon, Feb 19, 2018 at 12:40 PM, Henrik Johansson >>

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Henrik Johansson
Ok, good to know. Thanks! On Mon, Feb 19, 2018, 21:49 Ian Lance Taylor wrote: > On Mon, Feb 19, 2018 at 12:40 PM, Henrik Johansson > wrote: > > Yes I understand. I was just wondering if the GOCACHE flag is permanent > or > > as a temp safety in case someone encounters a bug in the caching. > >

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Ian Lance Taylor
On Mon, Feb 19, 2018 at 12:40 PM, Henrik Johansson wrote: > Yes I understand. I was just wondering if the GOCACHE flag is permanent or > as a temp safety in case someone encounters a bug in the caching. Ah. We are going to keep the GOCACHE environment variable around, because it can be used not

Re: [go-nuts] Client certificate in request missing

2018-02-19 Thread Maciej Gałkowski
Hi, This might be a red herring, but are you sure that your server requires a client cert? As far as I can understand the RFC https://tools.ietf.org/html/rfc5246#section-7.4.4, it is the server that sends a certificate request to the client so it can authenticate. W dniu poniedziałek, 19 lute

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Henrik Johansson
Yes I understand. I was just wondering if the GOCACHE flag is permanent or as a temp safety in case someone encounters a bug in the caching. On Mon, Feb 19, 2018, 21:35 Ian Lance Taylor wrote: > On Mon, Feb 19, 2018 at 12:08 PM, Henrik Johansson > wrote: > > Ah, that's not what I meant but GOCA

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Ian Lance Taylor
On Mon, Feb 19, 2018 at 12:08 PM, Henrik Johansson wrote: > Ah, that's not what I meant but GOCACHE var itself and if it will be > permanent as a way to disable the cache. Sorry, I'm not sure exactly what you are saying. There is no way to permanently disable the cache, other than always setting

Re: [go-nuts] intentional fmt spacing behavior in for statement initializer ?

2018-02-19 Thread Ian Lance Taylor
On Mon, Feb 19, 2018 at 11:11 AM, wrote: > https://play.golang.org/p/Pvhg_npsg3Y > > (padded with spaces - press fmt for output) > > > output : > > package main > > > import "fmt" > > > func main() { > > i, h, rs := 1, 1000, 160 > > > for y := i * (h / rs); y < (1+i)*(h/rs); y++ { > > fmt.Println

Re: [go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread Rob Pike
Jesper, I find myself in rare but mild disagreement about your claims for stack-based virtual machines. Please have a look at this short paper about the Dis VM from Inferno: http://flint.cs.yale.edu/jvmsem/doc/inferno.ps We found a JIT for Dis could be tiny, especially compared to Java JITs, and

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Henrik Johansson
Ah, that's not what I meant but GOCACHE var itself and if it will be permanent as a way to disable the cache. On Mon, Feb 19, 2018, 21:00 Ian Lance Taylor wrote: > On Sun, Feb 18, 2018 at 11:00 PM, Henrik Johansson > wrote: > > > > Why I wondered was because to build script (a tiny settings fil

Re: [go-nuts] Appropriate Go type for cgo void* param that accepts either an offset or pointer?

2018-02-19 Thread Jan Mercl
On Mon, Feb 19, 2018 at 8:35 PM Eric Woroshow wrote: > Using uintptr might work, but my concern is that passing a Go pointer into C by way of a uintptr value might confuse the GC (specifically, that the memory would fail to be pinned if/when Go implements a moving GC). Uintptr is an integer type

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Ian Lance Taylor
On Sun, Feb 18, 2018 at 11:00 PM, Henrik Johansson wrote: > > Why I wondered was because to build script (a tiny settings file really) for > Archlinux uses this flag to build it's Go packages. > Is it available as a paranoia "i really need all the tests run"? Will it be > removed later on? Sorry,

Re: [go-nuts] Re: invitation to gophers.slack.com

2018-02-19 Thread Sebastien Binet
you just have to head to: https://invite.slack.golangbridge.org/ hth, -s On Mon, Feb 19, 2018 at 11:54 AM, prince antony wrote: > > > On Saturday, March 28, 2015 at 3:06:31 PM UTC+5:30, Subhajit Datta wrote: >> >> Hi, >> Seems I can join the gophers slack group by admin invitation. >> May some

Re: [go-nuts] go fmt and CI (e.g. gitlab)

2018-02-19 Thread Stéphane Jeandeaux
Hi Jerome, You can take a look at git hooks https://golang.org/misc/git/pre-commit. Code: test -z "$(gofmt -s -l $(find . -name '*.go' -type f -print) | tee /dev/stderr)" Thanks and regards, Stephane Jeandeaux. On Mon, Feb 19, 2018 at 6:44 AM Jérôme LAFORGE wrote: > Hello Gophers, > Has any o

[go-nuts] Appropriate Go type for cgo void* param that accepts either an offset or pointer?

2018-02-19 Thread Eric Woroshow
There exist some OpenGL functions (e.g., glDrawElements ) where a single void* param accepts either a byte offset or a pointer value. What is the appropriate Go param type to wrap such C params? We can't use unsa

[go-nuts] Re: invitation to gophers.slack.com

2018-02-19 Thread prince antony
On Saturday, March 28, 2015 at 3:06:31 PM UTC+5:30, Subhajit Datta wrote: > > Hi, > Seems I can join the gophers slack group by admin invitation. > May some member of the group send me an invitation. > Thanks and Regards, > prince > princeanton...@gmail.com -- You received t

[go-nuts] Re: Dero: CryptoNote protocol + smart contracts using golang

2018-02-19 Thread 867cryptocurrency
There is a consensus among the developers that this is the license that they favor. For anyone else reading this that may be curious here is the GitHub link to the license https://github.com/deroproject/derosuite/blob/master/LICENSE On Sunday, February 18, 2018 at 9:15:16 PM UTC-8, Dave Cheney

[go-nuts] intentional fmt spacing behavior in for statement initializer ?

2018-02-19 Thread xiofen77
https://play.golang.org/p/Pvhg_npsg3Y (padded with spaces - press fmt for output) output : package main import "fmt" func main() { i, h, rs := 1, 1000, 160 for y := i * (h / rs); y < (1+i)*(h/rs); y++ { fmt.Println(y) } } note the extra space

Re: [go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread roger peppe
On 19 February 2018 at 17:36, Michael Jones wrote: > Matthew Juran wrote: "...but if you use maps, slices, append, make, you are > already using generics." > > This seems deeply insightful to me. Perhaps a better question than the > self-defeatingly open question of "how should Go embrace generics

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Nathan Kerr
I have also updated my release related resources: - Go Release Timeline - When Should You Upgrade Go? Enjoy! On Monday, February 19, 2018 at 6:17:18 AM UTC-7, Michel Casabianca

Re: [go-nuts] total newbie: parse html to plaintext

2018-02-19 Thread Shawn Milochik
It's hard to help without some more information. - What have you tried? - Is your source a file on disk, a string in memory, or from an htttp.Response.Body? - What do you mean by "parse"? In general, you can have a look at the html[1] library, which should have everything you need. If

[go-nuts] total newbie: parse html to plaintext

2018-02-19 Thread Thomas Kaufmann
Hi there, I'm a C++-Developer. But how can I parse in Go a html-file to plaintext? In C++ I use the index() method (with position parameter). Than the algorithm is simple. But in golang it seems very complicated. The solutions in the web are not satisfied. Sorry. I'm a bloody newbie;-). o-o

Re: [go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread Michael Jones
Matthew Juran wrote: *"...but if you use maps, slices, append, make, you are already using generics."* This seems deeply insightful to me. Perhaps a better question than the self-defeatingly open question of "how should Go embrace generics?" would be "what change would allow maps, slices, append,

Re: [go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread matthewjuran
> > I would probably never use it, like many people who comes to Go from C. But if you use maps, slices, append, make, you are already using generics. Maybe this is unfounded, but I'm far from convinced that generics would > make my experience of Go better. I'm really thinking here of, are we

[go-nuts] Re: Dero: CryptoNote protocol + smart contracts using golang

2018-02-19 Thread matthewjuran
Hi Serena, here’s a code review. imports can be grouped with parenthesis: import ( “fmt” “bytes” “testing” “encoding/hex” “github.com/deroproject/derosuite/config” ) vars and consts are often grouped this way too. I see this is done sometimes but mostly not. package+type l

Re: [go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread Henrik Johansson
I disagree that generics would decrease readability at the call site. Perhaps within the library where it is used but maybe not even there. The only complexity is within the compiler and other internals. This is not irrelevant by far but the carte blanche "generics is bad" is most often hyperbole.

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Johann Höchtl
Am Montag, 19. Februar 2018 14:17:18 UTC+1 schrieb Michel Casabianca: > > Hi Gophers, > > I have updated my list of Go interfaces for this release : > http://sweetohm.net/article/go-interfaces.en.html > > Just came across this very helpful overview (and sorry for hi-jacking the thread). Can gur

[go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread Ignazio Di Napoli
On Monday, February 19, 2018 at 4:04:12 PM UTC+1, Ignazio Di Napoli wrote: > > data2 := found.(float32) // THIS PANICS AT RUNTIME, data2 is int > Sorry, found is int. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from th

[go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread Ignazio Di Napoli
The only time I "needed" generics was for an r-tree container I wrote. I'd been much happier if I could statically catch my errors about contained data type, instead of catching them at runtime with panics during conversion. For example: x := 0.0 y := 0.0 data := 1 container

Re: [go-nuts] Re: Any plans to add ASN.1 PER support?

2018-02-19 Thread David Wahlstedt
Correction of my comment: "looked deep into this" -> "not looked deeply into this" ;-) Den måndag 19 februari 2018 kl. 15:15:01 UTC+1 skrev David Wahlstedt: > > There is also the following repo, that uses parser generators a la > yacc/lex to parse ASN.1 specifications and build abstract syntax t

Re: [go-nuts] Re: Any plans to add ASN.1 PER support?

2018-02-19 Thread David Wahlstedt
There is also the following repo, that uses parser generators a la yacc/lex to parse ASN.1 specifications and build abstract syntax trees of those, from which the encoder/coder code can be generated. https://github.com/chemikadze/asn1go Any arguments which one to prefer? Spontaneously I prefer t

[go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread Chris Hopkins
> > I think everybody here is aware that some people really want generics and > that generics would probably be useful for everybody. Instead of restating > that why not share what you think about this version of Go generics? > > IMO this is not a proven statement. One of the things that for me

Re: [go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread Jesper Louis Andersen
On Sun, Feb 18, 2018 at 4:47 AM Lars Seipel wrote: > > Go already has a NaCl backend which might fit the bill. See > misc/nacl/README for how to set it up. It links to a design document > (https://golang.org/s/go13nacl) with some background. > > The sucessor of that project is WebAssembly. WebAs

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Michel Casabianca
Hi Gophers, I have updated my list of Go interfaces for this release : http://sweetohm.net/article/go-interfaces.en.html Enjoy! 2018-02-19 8:00 GMT+01:00 Henrik Johansson : > Thx, > > Why I wondered was because to build script (a tiny settings file really) > for Archlinux uses this flag to buil

[go-nuts] Re: Tweaking sync.Pool for mostly-empty pools

2018-02-19 Thread Chris Hopkins
I would have expected the compiler to allowed to change: if len(l.shared) > 0 { # the racy check for non-emptiness l.Lock() last := len(l.shared) - 1 to tmp := len(l.shared) if tmp > 0 { # the racy check for non-emptiness l.Lock() last := tmp - 1 I'd be interested if this were a legal opti

[go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread dc0d
Yeah! And since I've learnt English mostly from SciFi and Fantasy movie heroes (with a misplaced sense of self-righteousness), I make boo boos from time to time - which are not that harmful and entertain people! :) There are other things that I might be interested to be improved about Go (MO-Or

[go-nuts] go fmt and CI (e.g. gitlab)

2018-02-19 Thread Jérôme LAFORGE
Hello Gophers, Has any one of you setted up the validation of format (goimports, go fmt) into Gitlab CI? My goal is to reject the commit that doesn't respect the Go's format. Thx in adv BR -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsu

[go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread RickyS
1. Oh, I'm all for improvement. I just want somebody to invent something in the field of re-use that is as much a breakthrough as Cooperating Sequential Processes was to the field of multi-processing. Go would be a good place to install that invention, as it is still a simple la

[go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread dc0d
This is a great talk on designing PLs, by Brian Kernighan in which he describes (too) how Perl stops being relevant by providing too little, too late. Again, improvements can be made in term of things other than just the syntax or s

[go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread dc0d
Dogan, Why does it have to be a breaking change? And there are other things too that are equally - if not more - important to me (the provided link to the list). RickyS, The success of Go in the field of application development (besides it's success in the devops and infrastructure sector) wa

[go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread Doğan Kurt
Generics would divide the Go community. I would probably never use it, like many people who comes to Go from C. People who are already experienced Go programmers also likely to avoid it. Java programmers on the other hand will surely overuse it. There it is, you have two different Go code bases

[go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread RickyS
Back when I first learned about the diamond problem with multiple inheritance, I've known we need someone to invent the next and better thing after inheritance. I do hope somebody smarter than me is somewhere trying. Or even has succeeded. And back when I first learned about the code bloat that

Re: [go-nuts] Client certificate in request missing

2018-02-19 Thread Miha Zoubek
Hello tnx for help. I tried like: tlsConfig := &tls.Config{ Certificates: []tls.Certificate{cert}, RootCAs: caCertPool, InsecureSkipVerify: false, } //tlsConfig.BuildNameToCertificate() transport := &http.Transport{TLSClientConfig: tlsConfig} client :

Re: [go-nuts] Client certificate in request missing

2018-02-19 Thread Jakob Borg
Try without using Config.BuildNameToCertificate. That’s a server side thing and I doubt it does what you want on the client side. //jb On 16 Feb 2018, at 14:41, mzou...@gmail.com wrote: Hello this is my code: https://play.golang.org/p/yxhYXEVMPjB I got certificate i