[go-nuts] Re: Save to store encryption key in Go executable?

2016-06-13 Thread as . utf8
You're right, even if you aren't planning to share the program, it's still a good idea to separate the key from the executable. For one, the executable is bigger and harder to keep secret than a few bytes of data. It's generally frowned upon to bundle the two since the secrecy should rely solel

[go-nuts] Re: Save to store encryption key in Go executable?

2016-06-13 Thread Haddock
Thanks for all the useful answers. All I want to do is to create an encryption program for simple home computing purposes. I once lost some encrypted files, because I lost the password. I think I did a typo when typing it in and didn't realize. So I thought I write my own encryption programm wi

Re: [go-nuts] Re: Better sum types for go

2016-06-13 Thread as . utf8
Thanks! On Monday, June 13, 2016 at 3:27:51 AM UTC-7, Jesper Louis Andersen wrote: > > > On Mon, Jun 13, 2016 at 1:58 AM, > wrote: > >> What research or other literature can you recommend on the topic of type >> theory? > > > Benjamin C. Pierce's "Types and Programming Languages", often abbreviat

[go-nuts] Re: Save to store encryption key in Go executable?

2016-06-13 Thread as . utf8
This is a key distribution problem, if you store the key in the executable you should assume everyone already has access to the key. This is a different problem than "can someone get the key out of running memory". If you store the key in the executable, then an existential compromise of this k

[go-nuts] Re: curious problem implementing RGB565 image

2016-06-13 Thread Dan Kortschak
Yes, that explains it. The simple summary is that I forgot the r,g,b,a are 16bit and was working with them as 8bit. This is why the image.RGBA worked, but the png decoded image did not - image.RGBA returned c|c<<8 for each channel, so the error was masked by having the low byte mimic the high byte

[go-nuts] Re: How to get executed query string after execution.

2016-06-13 Thread Harry
Hi Dave, Now, I'm developping cache system of query result to redis or another key-value store. Stored data are supposed that seriarized result of query using key serialized query string exected actually. Harry 2016年6月14日火曜日 10時23分25秒 UTC+9 Dave Cheney: > > If there was a way to get the conte

[go-nuts] Re: How to get executed query string after execution.

2016-06-13 Thread Dave Cheney
If there was a way to get the contents of the query string, what would you do with that information? On Tuesday, 14 June 2016 11:18:47 UTC+10, Harry wrote: > > Hi guys, > > I wonder that question. > Before execution, it's possible to get query by myself. > But I want to get executed query string

[go-nuts] How to get executed query string after execution.

2016-06-13 Thread Harry
Hi guys, I wonder that question. Before execution, it's possible to get query by myself. But I want to get executed query string actually. Is there any way to manage that? Thanks! -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe f

[go-nuts] Re: curious problem implementing RGB565 image

2016-06-13 Thread Nigel Tao
On Mon, Jun 13, 2016 at 9:10 PM, Dan Kortschak wrote: > Though doing the direct round trip of an image through an RGB565 gets > back the pixels in a state that you would expect, shown here in the > playground snippet: > > https://play.golang.org/p/UCwE4YJk21 Here's your color model function: fun

[go-nuts] Re: polymorphism (for Go 2.0), new fast playground is live

2016-06-13 Thread adamw
I believe this statement violate the code of conduct. I dug deep to refrain myself from toxic replies. I've read some idiotic crap posted by you on this mailing list, so you got a crap-ton of nerve to shoot off like that. This is an interested project. I'd like you to show respect, but if you c

[go-nuts] Re: polymorphism (for Go 2.0), new fast playground is live

2016-06-13 Thread adamw
I'd like to see changes to the standard library. Things that many people agree should be fixed but thwarted by go1 compat. The list is long and this mailing list is riddled with them. Possibly weeding out the standard library, kicking stuff to /x/. I'd provide generics through preprocessors wra

Re: [go-nuts] Proposal: extend the "don't care" value to more uses

2016-06-13 Thread Ian Lance Taylor
On Mon, Jun 13, 2016 at 2:17 PM, wrote: > consider > >> func Foo(a int, b string, x SomeStruct) > > > It would be nice if it was possible to pass in the "don't care" value, > a.k.a. "_" as one of the argument, as an alias for the default value of the > type. > >> pkg.Foo(a, b, _) > > > This way i

[go-nuts] Proposal: extend the "don't care" value to more uses

2016-06-13 Thread oli . gagnon4418
consider func Foo(a int, b string, x SomeStruct) It would be nice if it was possible to pass in the "don't care" value, a.k.a. "_" as one of the argument, as an alias for the default value of the type. pkg.Foo(a, b, _) This way if the user knows he doesn't care about the last value and th

Re: [go-nuts] goxpath: An XPath 1.0 parser

2016-06-13 Thread Chris Trenkamp
I've never used xmlpath, so I can't really compare them. However, I can talk about some of the design goals: - Provide a flexible-enough API so you can write your own functions in XPath expressions. - Abstract the tree to an interface so that not only can XML documents be parsed, bu

[go-nuts] Re: x509: failed to load system roots and no roots provided

2016-06-13 Thread Daniel Garcia
Hi Chris, This would be better answered by a docker mailing list. >From what you describe it looks like your container most likely doesn't contain the root certificates. See the following article: https://blog.codeship.com/building-minimal-docker-containers-for-go-applications/ You can also b

[go-nuts] x509: failed to load system roots and no roots provided

2016-06-13 Thread Chris Johnson
Hi, We have a container running a Golang 1.6 based app that tries to perform an OAuth request against GitHub. We are using the following "golang.org/x/oauth2" "golang.org/x/oauth2/github" I get the initial Auth page on GH, I click authorize, and the resulting callback leads me to a blank page

[go-nuts] Goque - Disk-based, high performance stacks, queues, and priority queues for Go

2016-06-13 Thread Conner Hewitt
Just finished this project and wanted to post here to post it here, get some feedback, and hopefully it will be useful for someone. GitHub link: https://github.com/beeker1121/goque It implements stacks, queues, and priority queues, all backed by the Go port of LevelDB

Re: [go-nuts] GoMobile window size always 800x800

2016-06-13 Thread Andy Brewer
I agree that good mobile UI should be responsive. I'm thinking this feature would be useful for testing your app on those wide range of mobile screen sizes. Right now, it's difficult to test apps made with gomobile because the viewport needs to be resized manually to see all the content. 1. Would

Re: [go-nuts] Race in text/collate?

2016-06-13 Thread 'Sugu Sougoumarane' via golang-nuts
I think the Go norm of assuming that things are not thread-safe unless stated otherwise makes sense. In this particular case, the function required the caller to provide a buffer to fill. That gave the impression that the Collator was stateless. It's possible that others could also get misled.

[go-nuts] Re: Save to store encryption key in Go executable?

2016-06-13 Thread Evan Digby
Apologies. I meant "as Axel" stated :) On Monday, 13 June 2016 10:06:12 UTC-7, Evan Digby wrote: > > As Haddock stated, it is basically impossible to prevent it from being > accessible to someone looking. Embedding as plaintext will be trivial to > extract, and essentially any method you use to

Re: [go-nuts] Guidelines for appropriate variable names, documentation, and overall readability

2016-06-13 Thread Rob Pike
The Go compiler is mostly a machine-translated C compiler originally written by a pre-Java programmer. That's not a value judgment, just a statement of fact. But it means that you are not looking at anything close to idiomatic Go code. One day little of this code will remain, but for now the names

[go-nuts] Guidelines for appropriate variable names, documentation, and overall readability

2016-06-13 Thread Kyle Stanly
The biggest difficulty I'm having reading other people's code is the sheer fact that, sometimes, they take the "Short variable name" guideline to heart. It's true that variables should be short enough to convey it's meaning,

[go-nuts] Re: Save to store encryption key in Go executable?

2016-06-13 Thread Evan Digby
As Haddock stated, it is basically impossible to prevent it from being accessible to someone looking. Embedding as plaintext will be trivial to extract, and essentially any method you use to encrypt/obfuscate it (encrypt the encryption??) will only be slightly less trivial to extract. Typically

Re: [go-nuts] Race in text/collate?

2016-06-13 Thread Michael Jones
Hmm… Not sure about repetitavely saying that specific data should not be accessed concurrently. Better may be to say that nothing (generally) should be accessed concurrently; that concurrency is accessed by a few special mechanisms that hide the concurrency behind a reasoned, reliable facade of

Re: [go-nuts] Save to store encryption key in Go executable?

2016-06-13 Thread 'Axel Wagner' via golang-nuts
Yes, it can (though that's not specific to go) and it's a theoretical impossibility to prevent it (otherwise DRM would be a *really* simple problem to solve…). On Mon, Jun 13, 2016 at 9:09 AM, Haddock wrote: > Hello, > > I'm developing my own little encryption application in Go. The Go > applica

[go-nuts] Save to store encryption key in Go executable?

2016-06-13 Thread Haddock
Hello, I'm developing my own little encryption application in Go. The Go application needs to know the key used for encryption and decryption. My question is whether that key can be extracted from the Go executable somehow through disassembly or looking at the applications memory or something.

[go-nuts] Loading X509 Key Pair with invalid Certificate

2016-06-13 Thread joel
Hello, We have been issued a client certificate that will not load (tls.LoadX509KeyPair) as it contains an identifier with an "_" in it - the underscore is not valid in the ASN.1 spec , although openssl and many other language implementations appear

Re: [go-nuts] Race in text/collate?

2016-06-13 Thread Sam Whited
On Mon, Jun 13, 2016 at 10:18 AM, roger peppe wrote: > No Go type should be assumed to be safe for concurrent use unless explicitly > documented otherwise (or obviously safe, for some definition of "obvious"). I think that's what I said? Either way it seems like there's no harm in being explicit.

Re: [go-nuts] Race in text/collate?

2016-06-13 Thread roger peppe
No Go type should be assumed to be safe for concurrent use unless explicitly documented otherwise (or obviously safe, for some definition of "obvious"). On 13 Jun 2016 17:14, "Sam Whited" wrote: > On Mon, Jun 13, 2016 at 3:16 AM, wrote: > > A single collator instance is NOT safe for concurrent

Re: [go-nuts] goxpath: An XPath 1.0 parser

2016-06-13 Thread Gustavo Niemeyer
Please note that the xmlpath package actually lives at: http://gopkg.in/xmlpath.v2 On Mon, Jun 13, 2016 at 3:27 AM, Henrik Johansson wrote: > How does it compare to https://godoc.org/launchpad.net/xmlpath? > I have been using it with great satisfaction but it is not complete to my > knowledge

Re: [go-nuts] Race in text/collate?

2016-06-13 Thread Sam Whited
On Mon, Jun 13, 2016 at 3:16 AM, wrote: > A single collator instance is NOT safe for concurrent use. The buffers are > only used to store the keys, but a Collator has some scratch buffers that > are used to avoid allocation. Maybe the documentation could state this explicitly? I think I probabl

[go-nuts] Re: polymorphism (for Go 2.0), new fast playground is live

2016-06-13 Thread charraster
On Monday, June 13, 2016 at 1:28:26 PM UTC+2, Sean Russell wrote: > > Interesting work. I understand this is very much a work in progress; how > would you (eventually) see the implementation of map(), e.g.: for reference, here is the mymap() http://tsoh.host/test.html#8e4ae712 it simply ru

[go-nuts] Re: polymorphism (for Go 2.0), new fast playground is live

2016-06-13 Thread charraster
On Monday, June 13, 2016 at 1:28:26 PM UTC+2, Sean Russell wrote: > > Interesting work. I understand this is very much a work in progress; how > would you (eventually) see the implementation of map(), e.g.: > > https://play.golang.org/p/GogrfKf-oA > a map() like this should already work > O

Re: [go-nuts] Better sum types for go

2016-06-13 Thread Viktor Kojouharov
I'm also for such types. There was also an interesting discussion about them here: https://www.reddit.com/r/golang/comments/46bd5h/ama_we_are_the_go_contributors_ask_us_anything/d03t6ji?context=3 On Monday, June 13, 2016 at 4:21:13 AM UTC+3, Michael Jones wrote: > > The position of the language d

[go-nuts] I found a quote that explains why I find Go beautiful!

2016-06-13 Thread Sean Russell
Nice! -- 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.com/d/optout.

[go-nuts] polymorphism (for Go 2.0), new fast playground is live

2016-06-13 Thread Sean Russell
Interesting work. I understand this is very much a work in progress; how would you (eventually) see the implementation of map(), e.g.: https://play.golang.org/p/GogrfKf-oA Or is this an accepted limitation of functionality for simplicity, that any single generic scope must have at most a singl

[go-nuts] Re: polymorphism (for Go 2.0), new fast playground is live

2016-06-13 Thread Viktor Kojouharov
Polymorphism is a far cry from a bad idea. On Monday, June 13, 2016 at 12:05:34 PM UTC+3, Peter Kleiweg wrote: > > Op zaterdag 11 juni 2016 22:31:06 UTC+2 schreef charr...@gmail.com: > > What do you need to be added to the Go language? >> > > A garbage collector for bad ideas. > -- You received

[go-nuts] curious problem implementing RGB565 image

2016-06-13 Thread Dan Kortschak
As part of my LEGO robotics project, I'm implementing image handling for various boards' frame buffers (EVB and EV3 in the first instance). Both are working as far as manual testing of rendered images goes, but automated testing has shown up a weird problem. This is best illustrated by looking at

Re: [go-nuts] Re: Better sum types for go

2016-06-13 Thread Jesper Louis Andersen
On Mon, Jun 13, 2016 at 1:58 AM, wrote: > What research or other literature can you recommend on the topic of type > theory? Benjamin C. Pierce's "Types and Programming Languages", often abbreviated TAPL, is a classic text on type theory. Working from the semanticists favorite toy language, the

[go-nuts] Re: Oden Language 0.3.0 released

2016-06-13 Thread Oskar Wickström
Yep, that sounds about right. :) Den måndag 13 juni 2016 kl. 08:59:53 UTC+2 skrev Tyler Compton: > > I believe it does, thank you. If I understand you correctly, Oden is to > the Go community a bit like what Scala is to the Java/JVM community. > > On Sunday, June 12, 2016 at 3:17:15 PM UTC-7, Osk

[go-nuts] Re: polymorphism (for Go 2.0), new fast playground is live

2016-06-13 Thread Nigel Vickers
You are so right! On Monday, 13 June 2016 11:05:34 UTC+2, Peter Kleiweg wrote: > > Op zaterdag 11 juni 2016 22:31:06 UTC+2 schreef charr...@gmail.com: > > What do you need to be added to the Go language? >> > > A garbage collector for bad ideas. > -- You received this message because you are s

[go-nuts] Re: polymorphism (for Go 2.0), new fast playground is live

2016-06-13 Thread Peter Kleiweg
Op zaterdag 11 juni 2016 22:31:06 UTC+2 schreef charr...@gmail.com: What do you need to be added to the Go language? > A garbage collector for bad ideas. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop r

Re: [go-nuts] Race in text/collate?

2016-06-13 Thread mpvl
A single collator instance is NOT safe for concurrent use. The buffers are only used to store the keys, but a Collator has some scratch buffers that are used to avoid allocation. I suggest using a new Collator per goroutine, if possible. On Sun, Jun 12, 2016 at 7:32 PM, 'Sugu Sougoumarane' via g

Re: [go-nuts] A question about passing arguments to closure

2016-06-13 Thread Henry
In "go func(int) { fmt.Println(i)}(i)", 'i' is passed as an argument, but it is not used. 'fmt.Println(i)' uses the variable 'i' that is inherited from the parent function, because 'i' is not defined by the function func(int) as an argument and the next available 'i' is the one inherited from t

[go-nuts] Re: Oden Language 0.3.0 released

2016-06-13 Thread Tyler Compton
I believe it does, thank you. If I understand you correctly, Oden is to the Go community a bit like what Scala is to the Java/JVM community. On Sunday, June 12, 2016 at 3:17:15 PM UTC-7, Oskar Wickström wrote: > > Glad you like it! :) > > The latter suggestion fits the goals of Oden better. It is