Re: [go-nuts] Unmarshalling and tags

2016-06-21 Thread Ain
teisipäev, 21. juuni 2016 9:47.54 UTC+3 kirjutas rog: > > I feel your pain - we quite often have tags with entries for three > formats (JSON, YAML and BSON) - but I'm not sure that collapsing them > is necessarily a good idea, as the named tags indicate that the object > is explicitly intended

[go-nuts] Re: A proposal for generic in go

2016-06-21 Thread andrew . mezoni
>> While later I realized that we still need some parameter check in the callee code to satisfy the interface matching (the generic version of each function in my proposal). A am sorry but your judgements is not correct. Here is a proofs: 1. It is redundant to perform check of the correctness of

[go-nuts] Re: [?] emulating an opengl shader in cpu bound functions

2016-06-21 Thread Egon
On Monday, 20 June 2016 18:02:53 UTC+3, blue...@gmail.com wrote: > > > > > I am attempting to generate a random starfield, in go. This is something > that will need to pri

Re: [go-nuts] [?] emulating an opengl shader in cpu bound functions

2016-06-21 Thread Daniel Skinner
I pinned this question to my email b/c I'm going to be doing something similar soon and why not help a similar soul out, but really even though I can't give you a straight answer now, the answer is still pretty straight forward. There's nothing predominantly interesting between a gpu shader and a

[go-nuts] Re: A proposal for generic in go

2016-06-21 Thread Henry
I think we should carefully consider whether generics is worthy enough to be added into the language. It is easy to add a feature, but nearly impossible to remove one without breaking the backward compatibility promise. One thing for sure is that we are in the middle of a paradigm shift. I am

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

2016-06-21 Thread Daniel Skinner
In my experience, designers aren't writing code or demoing experiences in native code. If they were, it wouldn't be that dissimilar to what I already see, either resizing a window or choosing a specific window size in chrome dev tools. Put bluntly, designers just aren't affected here and I think

[go-nuts] Re: How to manage a web portal with multiple services without stopping and restarting everything at each release/fix?

2016-06-21 Thread Benjamin Measures
On Thursday, 16 June 2016 16:02:50 UTC+1, romano.p...@gmail.com wrote: > > In Layman terms, if I had a portal in php I could (of course it depends on > situations) simply replace the pages of the module for the Service 1 > without the need to stop everything (not only Service 2,3,4 and so on but

[go-nuts] Re: How to manage a web portal with multiple services without stopping and restarting everything at each release/fix?

2016-06-21 Thread Benjamin Measures
On Sunday, 19 June 2016 09:53:34 UTC+1, Simon Ritchie wrote: > > Whichever you choose, it will not be as good as PHP in some respects and I > predict that speed of redeployment will be one of them. > When deploying to hundreds of servers, deploying hundreds of files to each becomes unmanageable

[go-nuts] Re: A proposal for generic in go

2016-06-21 Thread andrew . mezoni
>> I was one of the generics supporters for Go in this forum, but now I am not so sure. But why? Generic types is the same types as and the regular types. Difference only in that the regular types does not have a parameters but generic types are always have at least one parameter. This is why th

Re: [go-nuts] Send us your gophers!

2016-06-21 Thread Jan Mercl
On Sat, May 21, 2016 at 8:28 AM 'Andrew Gerrand' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Renee French and I are doing a little secret project and would love it if you would draw a gopher and sent it to us. Hi Andrew, is / will be there be some public output of your little secret

[go-nuts] Re: [?] emulating an opengl shader in cpu bound functions

2016-06-21 Thread Egon
On Monday, 20 June 2016 18:02:53 UTC+3, blue...@gmail.com wrote: > > > > > I am attempting to generate a random starfield, in go. This is something > that will need to p

[go-nuts] Re: A proposal for generic in go

2016-06-21 Thread Henry
I am not saying that generics is bad, but I am questioning whether generics is necessary. On Tuesday, June 21, 2016 at 3:45:08 PM UTC+7, andrew...@gmail.com wrote: > >> I was one of the generics supporters for Go in this forum, but now I am > not so sure. > > But why? > Generic types is the sa

[go-nuts] go get failing In Mac 10.11.4

2016-06-21 Thread DM
Hi On Mac OS X 10.11.4 *go get* is failing with the below error. jabongs-MacBook-Pro-4:florest debraj$ go get ./... go install github.com/jabong/florest/src/common/config: open /var/folders/lp /3q9_2mn51hd9s4yj_jcf3jxmgp/T/go-build823644730/github.com/jabong/ florest/src/common/config.a: no

[go-nuts] Re: [?] emulating an opengl shader in cpu bound functions

2016-06-21 Thread Egon
On Tuesday, 21 June 2016 12:50:16 UTC+3, Egon wrote: > > > > On Monday, 20 June 2016 18:02:53 UTC+3, blue...@gmail.com wrote: >> >> >> >> >> I am attempting to generate a

[go-nuts] Treeless: distributed NoSQL key-value DB written in Go

2016-06-21 Thread David M.
Hi, I've just released Treeless (https://github.com/dv343/treeless), a new distributed NoSQL key-value DB written in Go. I have been focused on performance and simplicity and I think I have achieved good results. For example, Get performance is 20% slower compared to Redis, but Set performance

Re: [go-nuts] [ANN] primegen.go: Sieve of Atkin prime number generator

2016-06-21 Thread alb . donizetti
> Do you plan to include SSA for the x86 version as well? For an answer to this: yes, it seems like the plan is to port every supported architecture to SSA. It was discussed here: https://groups.google.com/d/msg/golang-dev/fSIl5Sbr4ek/10sgOsnDEAAJ Il giorno martedì 21 giugno 2016 03:39:41 UTC+2

Re: [go-nuts] A proposal for generic in go

2016-06-21 Thread Micky
I guess that's for diplomatic reasons. If you watch talks of core contributors then I believe you'll know what I mean :) On Tue, Jun 21, 2016 at 5:15 AM, Rodrigo Kochenburger wrote: > Micky, I'm not sure where you're quoting from but they never said it's never > gonna happen. > > From the FAQ: "G

Re: [go-nuts] Fedora and crypto/elliptic.P224

2016-06-21 Thread Josh Chase
As far as I can tell, it's for patent reasons. They have a history of doing the same thing in similar instances with no more explanation than "the lawyers said so." On Monday, June 20, 2016 at 10:24:46 PM UTC-7, Henrik Johansson wrote: > > The second one, the redhat Bugzilla does. They only wan

[go-nuts] Re: A proposal for generic in go

2016-06-21 Thread andrew . mezoni
>> I am not saying that generics is bad, but I am questioning whether generics is necessary. Please, do not panic. If you worry about the following things: - Generated code will grow when used generics - Generated code will be more complex when used generics - Execution performance will slow down

Re: [go-nuts] Re: A proposal for generic in go

2016-06-21 Thread Ian Davis
On Tue, Jun 21, 2016, at 01:45 PM, andrew.mez...@gmail.com wrote: > >>I am not saying that generics is bad, but I am questioning whether > >>generics is necessary. > > Please, do not panic. > If you worry about the following things: > - Generated code will grow when used generics > - Generated co

Re: [go-nuts] Unmarshalling and tags

2016-06-21 Thread Nate Finch
I'd like to see something like this: type Payment struct { ActionType paypal.ActionType `xml,yaml,json:"actionType,omitempty"` ReceiverList paypal.ReceiverList `xml,yaml,json:"actionType,omitempty"` } -- You received this message because you are subscribed to the Google Groups "gol

[go-nuts] How to hide command line argument from ps

2016-06-21 Thread Hoping White
Hi, all I wonder is there a way to hide command line arguments from programs like “ps”? I can rewrite argv parameter for main in c language, or use LD_PRELOAD to intercept libc_start_main, but all these methods do not be functional in go. Thanks. -- You received this message because you a

Re: [go-nuts] Re: A proposal for generic in go

2016-06-21 Thread andrew . mezoni
>> increase in cognitive load to decipher chains of type definitions. Sorry, but who are members of this mail lists? This is a first time when I hear about such loads such as the `cognitive load`. Also I am possible here a single person who does not know anything about the `cognitive load to dec

Re: [go-nuts] Re: A proposal for generic in go

2016-06-21 Thread Ian Davis
On Tue, Jun 21, 2016, at 03:17 PM, andrew.mez...@gmail.com wrote: > >>increase in cognitive load to decipher chains of type definitions. > > Sorry, but who are members of this mail lists? > This is a first time when I hear about such loads such as the > `cognitive load`. > Also I am possible here

[go-nuts] Re: A proposal for generic in go

2016-06-21 Thread Henry
You still haven't provided any argument why generics is indispensable. The reason why I am no longer sure about my position in this issue is because -while I agree that generics is useful- I don't think that generics is essential. In fact, all of C++ features are useful and implemented in a ver

Re: [go-nuts] How to hide command line argument from ps

2016-06-21 Thread Konstantin Khomoutov
On Tue, 21 Jun 2016 22:16:38 +0800 Hoping White wrote: > I wonder is there a way to hide command line arguments from > programs like “ps”? I can rewrite argv parameter for main in c > language, or use LD_PRELOAD to intercept libc_start_main, but all > these methods do not be functional in go. Tha

Re: [go-nuts] How to hide command line argument from ps

2016-06-21 Thread Matt Harden
It's generally a bad idea to try to improve security by hiding args. Much better to pass the argument another way, for instance via an open file descriptor that the program reads the value from. On Tue, Jun 21, 2016, 07:16 Hoping White wrote: > Hi, all > >I wonder is there a way to hide comm

Re: [go-nuts] Re: A proposal for generic in go

2016-06-21 Thread andrew . mezoni
>> What I mean is that most people who have followed the past generics discussions already know it's possible to implement them with efficient memory use and performance. So they don't need to worry much about that. Thank you for explanation. >> can they be implemented without making Go a much

Re: [go-nuts] go get failing In Mac 10.11.4

2016-06-21 Thread Debraj Manna
Below is the ouput using the -x flag:- jabongs-MacBook-Pro-4:florest debraj$ go get -x ./... WORK=/var/folders/lp/3q9_2mn51hd9s4yj_jcf3jxmgp/T/go-build665863426 mkdir -p $WORK/github.com/jabong/floRest/src/examples/_obj/ mkdir -p $WORK/github.com/jabong/floRest/src/ cd /Users/debraj/golang

[go-nuts] semantics of byteCount in gob encoding

2016-06-21 Thread Alex Flint
The gob docs state that a gob stream consists of (byteCount (-type id, encoding of a wireType)* (type id, encoding of a value))* I was expecting byteCount to be the number of bytes remaining in the entire packet, but that does not seem to be the case. For example when encoding a single instan

[go-nuts] feature request: allow literal digit underscore grouping

2016-06-21 Thread Roger Pack
I found recently when doing some language comparisons In a few other languages (ruby, java, etc.) underscores within numeric literals to make them more readable, ex: 10_000_000.times do ... end go ex: for i := 0; i < 1000; i++ { ... } I find it helps readability, and think it would be a

Re: [go-nuts] semantics of byteCount in gob encoding

2016-06-21 Thread Rob Pike
It's as advertised, 1 count byte (1a=26) followed by 26 bytes, followed by one count byte (5), followed by 5 bytes. Note the final '*' in that grammar. -rob On Tue, Jun 21, 2016 at 8:20 AM, Alex Flint wrote: > The gob docs state that a gob stream consists of > > (byteCount (-type id, encodi

Re: [go-nuts] Re: A proposal for generic in go

2016-06-21 Thread Egon
On Tuesday, 21 June 2016 17:18:04 UTC+3, andrew...@gmail.com wrote: > > >> increase in cognitive load to decipher chains of type definitions. > > Sorry, but who are members of this mail lists? > This is a first time when I hear about such loads such as the `cognitive > load`. > https://docs.googl

Re: [go-nuts] semantics of byteCount in gob encoding

2016-06-21 Thread Alex Flint
Oh I expected that since I only called encoder.Encode once, there would only be on repetition of the outermost segment. I was expecting the wireType to be within the inner "(-type id, encoding of a wireType)*" segment. Otherwise shouldn't the spec be ((byteCount, -type id, encoding of a wireTy

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-21 Thread Caleb Spare
This was shut down without much discussion at https://github.com/golang/go/issues/42. I agree that it's a nice feature. By the way, though, one nice aspect of Go is that because of how untyped constants work you can write integers using scientific notation: for i := 0; i < 10e6; i++ { //

[go-nuts] Re: A proposal for generic in go

2016-06-21 Thread xingtao zhao
For example: type Int int func (i Int) Add(j Int) Int { return i + j } type Number> interface { Add(j T) T } If we want Int satisfy the interface Number, we have to create two versions of function Int.Add, one for concrete type Int, one with generic type T And if we want to support: var

Re: [go-nuts] feature request: allow literal digit underscore grouping

2016-06-21 Thread Michael Jones
I asked for this a while back ("drop underscore between digits as in Ada") and the answer was no. I try to ask just once. This was shut down without much discussion at https://github.com/golang/go/issues/42. I agree that it's a nice feature. By the way, though, one nice aspect of Go is that beca

Re: [go-nuts] Re: A proposal for generic in go

2016-06-21 Thread 'Axel Wagner' via golang-nuts
The issue is, that a "KeyValuePair" (no matter if you implemented it via generics or like you mention via interfaces) is a fundamentally useless type and generics encourage people to add useless types. A "KeyValuePair" is a "struct { Key K, Value V }", plain and simple. It's not an interface and it

Re: [go-nuts] Re: A proposal for generic in go

2016-06-21 Thread xingtao zhao
I totally agree that I always want generics mainly when I am writing a framework. But I do not agree with you on that "go is pretty much a language for writing applications". I don't think go is powerful enough that we do no need any framework. I don't think we can always develop applications f

Re: [go-nuts] Go test to run over sub packages?

2016-06-21 Thread gabriel . kopley
Is `$ go test github.com/foo/proj/...` really supposed to work? When I run it I get warning: "github.com/foo/proj/..." matched no packages no packages to test But `cd sr

[go-nuts] Looking for go usage on QNX

2016-06-21 Thread esealman
Hello, Looking for using go on QNX OS. I can see that gc isn't supported on QNX, but I thought might work since Plan9, freeBSD etc are supported. Additional solution can be the gccGo, so appreciate any help recommendation on both approaches. Thanks, Efraim -- You received this message becaus

Re: [go-nuts] Re: A proposal for generic in go

2016-06-21 Thread 'Axel Wagner' via golang-nuts
On Tue, Jun 21, 2016 at 9:38 PM, xingtao zhao wrote: > I totally agree that I always want generics mainly when I am writing a > framework. But I do not agree with you on that "go is pretty much a > language for writing applications". I don't think go is powerful enough > that we do no need any fr

[go-nuts] Handling panics in go_kafka_client

2016-06-21 Thread chandradeepak . k
Hi, We are trying to build an application using the go_kafka_client, for managing the consumer creation etc. We find it very convenient and easy to use. Thanks for building! But in the go_kafka_client code we see a lot of panics. For example we created a consumer for a topic that doesn't exis

[go-nuts] Re: Handling panics in go_kafka_client

2016-06-21 Thread deepak chandra
Oops, wrong forum! Will post it to the correct one. Thanks! On Tue, Jun 21, 2016 at 2:54 PM, Venkatesh S R wrote: > > > On Tue, Jun 21, 2016 at 2:51 PM, wrote: > >> Hi, We are trying to build an application using the go_kafka_client, for >> managing the consumer creation etc. We find it very c

[go-nuts] Getting a pointer in a type switch gives a *interface {} if case lists several options

2016-06-21 Thread raidopahtma
I have encountered some unexpected and inconsistent behavior with type switches. Can someone shed some light as to why Go behaves this way? Take a look at https://play.golang.org/p/YPV5YPtWF8 I would expect both of the switches to behave the same way, but for some reason the one with multiple o

Re: [go-nuts] A proposal for generic in go

2016-06-21 Thread Alex Bligh
On 21 Jun 2016, at 19:55, 'Axel Wagner' via golang-nuts wrote: > The issue is, that a "KeyValuePair" (no matter if you implemented it > via generics or like you mention via interfaces) is a fundamentally useless > type and generics encourage people to add useless types. A "KeyValuePair V>" is

Re: [go-nuts] Go test to run over sub packages?

2016-06-21 Thread Ian Lance Taylor
On Tue, Jun 21, 2016 at 12:42 PM, wrote: > Is `$ go test github.com/foo/proj/...` really supposed to work? Yes. > When I run it I get > > warning: "github.com/foo/proj/..." matched no packages > no packages to test > > But `cd src/github.com/foo/proj && go test ./...` does work as suggested. W

Re: [go-nuts] Getting a pointer in a type switch gives a *interface {} if case lists several options

2016-06-21 Thread Jan Mercl
On Wed, Jun 22, 2016 at 12:01 AM wrote: > I have encountered some unexpected and inconsistent behavior with type switches. Can someone shed some light as to why Go behaves this way? if a type switch case lists distinct types, one option is to reject such case - or allow it without the type being

Re: [go-nuts] Go test to run over sub packages?

2016-06-21 Thread gabriel . kopley
Hi Ian, thanks for the confirmation! It turns out that the cause of this behavior is that I had followed the instructions at https://github.com/karlseguin/the-little-go-book/blob/9f95b4405760fe9d24d4f9b7da93889cc9306f58/en/go.md#getting-started and symlinked thus: `$ ln -s ~/code/golang-worksp

Re: [go-nuts] Re: A proposal for generic in go

2016-06-21 Thread adamw
On Tuesday, June 21, 2016 at 2:56:01 PM UTC-4, Axel Wagner wrote: > > The issue is, that a "KeyValuePair" (no matter if you implemented it > via generics or like you mention via interfaces) is a fundamentally useless > type and generics encourage people to add useless types. A "KeyValuePair V>"

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

2016-06-21 Thread Andy Brewer
OK, it sounds like it's more complicated than I thought to expose those screen dimensions to the API. There are a good (and growing) number of designers like me who code and the gomobile tool is too barebones at the moment to be productive for testing UI across multiple screen size or horizontal v

[go-nuts] A proposal for generic in go

2016-06-21 Thread Marcus Yip
On Tuesday, June 21, 2016 at 2:56:01 PM UTC-4, Axel Wagner wrote: The issue is, that a "KeyValuePair" (no matter if you implemented it via generics or like you mention via interfaces) i -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscri

[go-nuts] Re: A proposal for generic in go

2016-06-21 Thread adamw
generics would greatly improve code reuse for many algorithms- this one fact alone trumps all opposition. In fact, go's builtin container types have generics-like functionality already. Imagine arrays, slices, maps without this functionality- exactly, enough said. the arguments against generics

Re: [go-nuts] Go test to run over sub packages?

2016-06-21 Thread Dave Cheney
I'm sorry to say that that is bad advice. Symlinks and the go tools should be avoided. On Wednesday, 22 June 2016 08:29:33 UTC+10, gabriel...@gmail.com wrote: > > Hi Ian, thanks for the confirmation! > > It turns out that the cause of this behavior is that I had followed the > instructions at >

Re: [go-nuts] How to hide command line argument from ps

2016-06-21 Thread Hoping White
Thanks for all the replies. I agree that there is a better way to do the security jobs. I ask this question just for curiosity, to find out if there is a equivalence way to do this in golang. From all the replies I assume there is a no. > 在 2016年6月21日,下午10:39,Matt Harden 写道: > > It's generall

[go-nuts] Re: A proposal for generic in go

2016-06-21 Thread Matt Ho
I think I have to agree with most of the posters here about generics. In theory, I miss them. However, in practice, I find that there are usually only a few times during the course of a project where I wish I had generics. And then after writing a few lines of code to do what the generic wou

Re: [go-nuts] go get failing In Mac 10.11.4

2016-06-21 Thread Krzysztof Kowalczyk
My guess is that's because Mac filesystem is case preserving but not case-sensitive, meaning that in mac os "floRest" and "florest" is the same file/directory while on linux those are 2 distinct files. (you can configure mac filesystem to be case-sensitive as well, but that's not the default).

Re: [go-nuts] Re: A proposal for generic in go

2016-06-21 Thread andrew . mezoni
>> The issue is, that a "KeyValuePair" (no matter if you implemented it via generics or like you mention via interfaces) is a fundamentally useless type and generics encourage people to add useless types. A "KeyValuePair" is a "struct { Key K, Value V }", plain and simple. It's not an interface

[go-nuts] Re: [offtopic] go standard library growth, 2009-2016

2016-06-21 Thread Torsten Bronger
Hallöchen! andrey mirtchovski writes: > [...] > > Attached are graphs the total keyword count and a 10-mile overview of > all the keywords and their growth. One "if" every 3.5 lines of code ... Tschö, Torsten. -- Torsten BrongerJabber ID: torsten.bron...@jabber.rwth-aachen.de -- You re

[go-nuts] windows gamepad access

2016-06-21 Thread rbirac
Hi all, I'm just getting started with Go and, for various reasons, want to run under Windows 10. I need to read a gamepad (x360) which is read by a Windows hid driver. I can't find any posts here or elsewhere that give an easy explanation of how to do so. Is there anything in the standar

Re: [go-nuts] Go test to run over sub packages?

2016-06-21 Thread Nate Finch
+1 to what Dave said. Don't use symlinks. Embrace the GOPATH, and you'll have a much better time. I actually put all code in my GOPATH now, even code that isn't Go. It's just easier to find if I know to go look in the right directory for the code's URL. There's two easy hacks to avoid typin

[go-nuts] Re: Example for using JWT with SermoDigital/jose/jws

2016-06-21 Thread macmillan . josh09
It's working now. I had to uncomment this line: claims.Set("AccessToken", "level1") Thanks! On Monday, June 20, 2016 at 7:14:10 PM UTC-7, macmilla...@gmail.com wrote: > > I get this error 'Error serializing the key. json: error calling > MarshalJSON for type jws.Claims: unexpected end of JSON i