[go-nuts] Go import tree

2017-07-29 Thread Tong Sun
Is there any tools out there that can show import tree for Go projects? I.e., the dependency graph that shows who imports what packages. During `go build -v` I saw one (3rd party) package that shouldn't be included, and am wondering who is introducing that dependency. How can I find out? Thx.

[go-nuts] Re: Go Proxy Using HTTP Standard Library

2017-07-29 Thread Collin VanDyck
Have you taken a look at https://golang.org/pkg/net/http/httputil/#ReverseProxy ? Also, I think nginx may be a good fit for this unless you just wanted to do it programatically. On Wednesday, July 26, 2017 at 11:35:00 AM UTC-4, Andrew wrote: > > Hi, > > I've installed a Discourse forum

Re: [go-nuts] Storing uint64 values in DB

2017-07-29 Thread Andy Balholm
var i uint64 var j int64 … j = int64(i) This performs the same conversion that C would do automatically when assigning i to j, but Go requires you to be a little more explicit. > On Jul 29, 2017, at 6:54 PM, Tong Sun wrote: > > Neither PostgreSQL[1] nor SQLite[2] support

[go-nuts] Storing uint64 values in DB

2017-07-29 Thread Tong Sun
Neither PostgreSQL[1] nor SQLite[2] support unsigned 64-bit integers at the SQL level. However, I do need to save those unsigned 64-bit integers as-is into database, as they are not numbers but hash values. What's the proper way to cast my uint64 as database *signed* integer and back safely

Re: [go-nuts] Re: No Allman-Style, No go!

2017-07-29 Thread ecstatic . coder
LOL, obviously you haven't read my previous posts ;) Ok, I'll repeat it then, no problem. I'm actually the developer of an open source preprocessor (Genesis) that can also be used to add Allman style and pseudo-generics to Go. And internally I also use a templating language similar to PHP

Re: [go-nuts] Re: No Allman-Style, No go!

2017-07-29 Thread Hrobjartur Thorsteinsson
Dude, you are right. This confusing coding style with syntax in Go can be fixed by forking and applying a rediculously small patch. Jeez, lets stop complaining as u rightfully suggested. 29. júl. 2017 10:43 e.h. skrifaði "Wojciech S. Czarnecki" : > On Sat, 29 Jul 2017 10:36:42

Re: [go-nuts] Re: No Allman-Style, No go!

2017-07-29 Thread Shawn Milochik
Without apologies, I am linking to a post I wrote seconds ago regarding generics. It applies here equally. Perhaps more so, since the percentage of brace-complainers is a tiny fraction of the percentage of generics-whiners: https://groups.google.com/d/msg/golang-nuts/hQiZsd1ZRdA/DSgV7CX7BwAJ --

Re: [go-nuts] Re: Generics are overrated.

2017-07-29 Thread Shawn Milochik
As with every community, there's the silent majority and the vocal minority. It's easy to be confused, and think that the lack generics is a major issue in the Go community. It is *not*. The number 500,000 Go developers worldwide has been thrown around a lot this month.

Re: [go-nuts] Re: Generics are overrated.

2017-07-29 Thread Jesper Louis Andersen
On Sat, Jul 29, 2017 at 6:36 PM wrote: > I just want to know sincerely, if people REALLY need generics so much, or > they are just complaining because they are used to it and it's in their > favorite programming language. > > Generics tend to serve at least two purposes

Re: [go-nuts] No Allman-Style, No go!

2017-07-29 Thread Andy Balholm
I’ve always considered the lexer to be part of the compiler, and apparently Ecstatic Coder does too, considering his complaint. Andy > On Jul 29, 2017, at 2:58 PM, Jan Mercl <0xj...@gmail.com> wrote: > > On Sat, Jul 29, 2017 at 10:43 PM Andy Balholm

Re: [go-nuts] No Allman-Style, No go!

2017-07-29 Thread Jan Mercl
On Sat, Jul 29, 2017 at 10:43 PM Andy Balholm wrote: > It’s not quite true that the compiler doesn’t care about white space. The lexer is part of the compiler, and it does care about white space. The semicolon insertion rule, in particular, pays attention to newlines. So,

Re: [go-nuts] No Allman-Style, No go!

2017-07-29 Thread Andy Balholm
It’s not quite true that the compiler doesn’t care about white space. The lexer is part of the compiler, and it does care about white space. The semicolon insertion rule, in particular, pays attention to newlines. So, while the compiler doesn’t care about indentation at all, there are some

Re: [go-nuts] Re: No Allman-Style, No go!

2017-07-29 Thread Jan Mercl
On Sat, Jul 29, 2017 at 7:36 PM wrote: > But as Gofmt can ALREADY enforces this common coding style, and can be run at any time, including before committing code on the depots, why should it be enforced by the COMPILER too ? Let me pick just one misconception. The

Re: [go-nuts] Re: No Allman-Style, No go!

2017-07-29 Thread Michael Jones
I understand you now. On Sat, Jul 29, 2017 at 10:36 AM wrote: > Sorry to repeat myself, but I think I wasn't clear enough, as many people > on this forum still don't understand my point at all. > > Google, as ANY company, MUST force its employees to use exactly the

Re: [go-nuts] Re: Generics are overrated.

2017-07-29 Thread Robert Melton
On Sat, Jul 29, 2017, at 13:33, dogan.k...@dodobyte.com wrote: >> Also, building a basic one yourself if you don't want to use those tends to >> be exceptionally straightforward. > > Thanks for examples, i can't tell if they are experimental or viable for > production use. I am not sure the

Re: [go-nuts] Re: Generics are overrated.

2017-07-29 Thread Daniel
I'm curious: are there use-cases where template generation with gengen/genny/etc are not enough? seems to me that calling "go generate" a few times (when you need to generate generic containers for certain types) is a very fair tradeoff to have generic containers without having to change the

Re: [go-nuts] Re: No Allman-Style, No go!

2017-07-29 Thread ecstatic . coder
Sorry to repeat myself, but I think I wasn't clear enough, as many people on this forum still don't understand my point at all. Google, as ANY company, MUST force its employees to use exactly the same standards. I've done the same with the engineers in my company. And they used my own code

Re: [go-nuts] Re: Generics are overrated.

2017-07-29 Thread dogan . kurt
> > Also, building a basic one yourself if you don't want to use those tends > to be exceptionally straightforward. > Thanks for examples, i can't tell if they are experimental or viable for production use. But if it's that straightforward, why people complain about it too much. I

Re: [go-nuts] Movable pointees inquiry

2017-07-29 Thread Jan Mercl
On Sat, Jul 29, 2017 at 6:34 PM Ian Lance Taylor wrote: > Yes, that sounds correct. ... Thank you very much, Ian. -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

[go-nuts] Experience using Go for a student projet

2017-07-29 Thread Juliusz Chroboczek
Dear all, I've just finished supervising three fourth year students doing a month-long summer project in Go. I thought some of you might be interested in my conclusions. The students were decent C programmers but had more experience with Java (and I am not an experienced Go programmer myself).

[go-nuts] Re: Generics are overrated.

2017-07-29 Thread dogan . kurt
I was watching rus cox's last talk and he mentioned that not every problem should be solved by language change. Some can be solved by tooling or library change. I am curious has any of the generics lovers written a tool that helps for generic

Re: [go-nuts] Movable pointees inquiry

2017-07-29 Thread Ian Lance Taylor
On Sat, Jul 29, 2017 at 3:20 AM, Jan Mercl <0xj...@gmail.com> wrote: > > I would like to ask for confirmation if I understand correctly few items. > Thank in advance for the answer(s). > > Bellow let's consider only correct, valid, race-free "normal" programs that > do not use CGO or directly call

Re: [go-nuts] go get and protos (protoc; grpc)

2017-07-29 Thread Timothy Raymond
I've used `go generate` and typically check in the generated *.pb.go. There's some formatting weirdness when contributers have different versions of the `protoc` binary, but nothing that causes anything to break. -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Re: Generics are overrated.

2017-07-29 Thread Jan Mercl
On Sat, Jul 29, 2017 at 5:18 PM wrote: > write a compile time type safe generic reduce function with the following signature which works for all slices of any element type : > > func reduce(array []A,out B,in A)B {} > you can't do that in Go . You've nonchalantly

[go-nuts] Re: Generics are overrated.

2017-07-29 Thread prades . marq
I love playing with package reflect, which is much more powerful than generics by the way (you can't implement gob or json with generics). You could absolutely do that without runtime reflection. It is called compile time type safe macros ... Oh wait, Rust has them, and generics and a correct

[go-nuts] Re: Generics are overrated.

2017-07-29 Thread Roberto Zanotto
I love playing with package reflect, which is much more powerful than generics by the way (you can't implement gob or json with generics). On Saturday, July 29, 2017 at 3:28:56 PM UTC+2, M P r a d e s wrote: > > What is overrated is the use of "interface { }" and reflection AKA runtime > magics

Re: [go-nuts] Re: Generics are overrated.

2017-07-29 Thread Jan Mercl
On Sat, Jul 29, 2017 at 3:28 PM wrote: > What is overrated is the use of "interface { }" and reflection AKA runtime magics which has no place in a modern statically typed language. interface{} is not a replacement of generics. Interfaces with a real methods set, like

[go-nuts] Re: Generics are overrated.

2017-07-29 Thread prades . marq
What is overrated is the use of "interface { }" and reflection AKA runtime magics which has no place in a modern statically typed language. It's a cop-out, it's dirty and a direct consequence of the absence of generics in Go. > Please provide some best practices to achieve generic behavior for