[go-nuts] Re: Disadvantage of Go

2017-01-13 Thread Egon
As Shawn mentioned, most of these were decided against for varying reasons. I'll try to give as much info as I can remember. On Friday, 13 January 2017 09:44:10 UTC+2, hui zhang wrote: > > Disadvantage of Go > 1 No Generic For Now > That make user coding repeat code many times, even for basic ty

[go-nuts] Re: Disadvantage of Go

2017-01-13 Thread Egon
I also forgot to mention that Go is not "perfect" for everything and it tries not to be. Sometimes the correct answer is some other language (e.g. Matlab, R, Julia, C, Rust, Chapel, Haskell, Prolog, Erlang... and, many, many more) + Egon On Friday, 13 January 2017 10:39:55 UTC+2, Egon wrote: >

[go-nuts] Re: Disadvantage of Go

2017-01-13 Thread hui zhang
thank u very much. I know they all have work around. and I also write some util my own. I just wish go to make it more simpler, wish the code could be clean and short . Right now go let programer do repeat and Mechanical work the top 3 are bothering me most [1],[2] let me do many type cast a

[go-nuts] Re: Autocert on localhost?

2017-01-13 Thread mhhcbon
not really. https://community.letsencrypt.org/t/can-i-test-lets-encrypt-client-on-localhost/15627 But if you search more, you might find posts providing some solutions using more complex network design. For my own, I decided to use https://github.com/mh-cbon/gssc for my localhost. Have a swit

[go-nuts] Re: Disadvantage of Go

2017-01-13 Thread Egon
On Friday, 13 January 2017 11:26:29 UTC+2, hui zhang wrote: > > thank u very much. I know they all have work around. and I also write > some util my own. > I just wish go to make it more simpler, wish the code could be clean and > short . > Right now go let programer do repeat and Mechanical

Re: [go-nuts] Disadvantage of Go

2017-01-13 Thread roger peppe
On 13 January 2017 at 07:44, hui zhang wrote: > 4 Can not Cycle import. In my opinion, this is one of Go's really great features. When software becomes larger, there is huge pressure to create cyclic dependencies between packages. Once you start to get cyclic dependencies, the system as a whole t

Re: [go-nuts] Disadvantage of Go

2017-01-13 Thread Egon
On Friday, 13 January 2017 11:56:48 UTC+2, rog wrote: > > On 13 January 2017 at 07:44, hui zhang > > wrote: > > 4 Can not Cycle import. > > In my opinion, this is one of Go's really great features. When software > becomes > larger, there is huge pressure to create cyclic dependencies between

Re: [go-nuts] xml for a person used to python's lxml - multiple attributes

2017-01-13 Thread Sayth Renshaw
On Thursday, 5 January 2017 04:27:50 UTC+11, Kevin Powick wrote: > > > > On Monday, 2 January 2017 22:03:15 UTC-5, Sayth Renshaw wrote: >> >> Is there a good simple ORM or pipeline to push data to a database like >> SQLite? >> > > Many popular packages (libraries) for Go can be found by category

Re: [go-nuts] Re: State of the database drivers in go

2017-01-13 Thread snmed
Thats great to hear, i will start a prototype of the project with postgres and mongodb. Then i will see if our needs are satisfied and if we stay with go. :-) I really hope it is working out for us, i would prefer to use go now and in the future:-D Cheers Am Donnerstag, 12. Januar 2017 16:42:52

[go-nuts] logical

2017-01-13 Thread Sayth Renshaw
The thing about Go is that its largely simple and logical. You get what you expect nothing less nothing more, its not fancy nor surprising it just is. There are many things I have yet to learn in Go but if I keep getting out exactly what I expext then I am sure to keep learning. Sayth -- You r

Re: [go-nuts] Re: State of the database drivers in go

2017-01-13 Thread Konstantin Khomoutov
On Thu, 12 Jan 2017 18:42:38 +0300 Josh Kamau wrote: [...] > I have read good reviews for mgo but i have not used it personally Okay, there's a negavite one to balance your fascination ;-) http://cryto.net/~joepie91/blog/2015/07/19/why-you-should-never-ever-ever-use-mongodb/ [...] -- You rece

Re: [go-nuts] Re: State of the database drivers in go

2017-01-13 Thread Henrik Johansson
That's Mongodb itself, not the Go driver. On Fri, Jan 13, 2017, 14:08 Konstantin Khomoutov < flatw...@users.sourceforge.net> wrote: > On Thu, 12 Jan 2017 18:42:38 +0300 > Josh Kamau wrote: > > [...] > > I have read good reviews for mgo but i have not used it personally > > Okay, there's a negavi

[go-nuts] How do you mitigate against nil pointer dereference

2017-01-13 Thread mailteety
Hello, Have been struggling with mitigating against nil pointer deference and i would appreciate if anyone can help Code 1: Works file https://play.golang.org/p/lhOh9g5R9l Code 2: Error https://play.golang.org/p/pY4F9bK-D9 How do you validate Attr was set if its a pointer ? Thanks In A

[go-nuts] [gomobile] Is it possible to call my own ObjC code from Go using reverse binding?

2017-01-13 Thread nik . kunevich
Hello, everyone! As I know gomobile now supports reverse binding for ObjC (thanks @elisnaur). I'd like to know - is it working only for system modules or I can use it to call my own ObjC code from go as well? -- You received this message because you are subscribed to the Google Groups "golang-

Re: [go-nuts] Re: State of the database drivers in go

2017-01-13 Thread snmed
Hi Konstantin I'm absolutely aware of the impact of a NoSql database and how a datastructure has to be design for an effectiv use of MongoDb, but thank you anyway for your contribution. Cheers Am Freitag, 13. Januar 2017 14:08:39 UTC+1 schrieb Konstantin Khomoutov: > > On Thu, 12 Jan 2017 18:4

Re: [go-nuts] Re: State of the database drivers in go

2017-01-13 Thread Konstantin Khomoutov
On Fri, 13 Jan 2017 13:20:28 + Henrik Johansson wrote: > > > I have read good reviews for mgo but i have not used it personally > > > > Okay, there's a negavite one to balance your fascination ;-) > > > > http://cryto.net/~joepie91/blog/2015/07/19/why-you-should-never-ever-ever-use-mongodb/ >

[go-nuts] Re: How do you mitigate against nil pointer dereference

2017-01-13 Thread mhhcbon
Hi, some simple leads, Use one line initialization of Person p := &Person{Attr:&Attribute{}} Enhance the if conditions statement if p.Attr != nil && p.Attr.Age < 10 { fmt.Println("Too Young") } Use a Person constructor func NewPerson() &Person { return &Person{Attr:&Attribut

Re: [go-nuts] Re: State of the database drivers in go

2017-01-13 Thread Henrik Johansson
Honestly I have had some less than pleasant incidents with Mongodb as well but the fault was due to simply overusing it for stuff it's not meant for. On Fri, Jan 13, 2017, 14:36 Konstantin Khomoutov < flatw...@users.sourceforge.net> wrote: > On Fri, 13 Jan 2017 13:20:28 + > Henrik Johansson

Re: [go-nuts] Re: How do you mitigate against nil pointer dereference

2017-01-13 Thread Henrik Johansson
Expose properties as methods and do the check in the method can make the caller use easier. On Fri, Jan 13, 2017, 14:41 wrote: > Hi, > > some simple leads, > > Use one line initialization of Person > p := &Person{Attr:&Attribute{}} > > Enhance the if conditions statement > if p.Attr != nil &

Re: [go-nuts] How do you mitigate against nil pointer dereference

2017-01-13 Thread Ian Davis
On Fri, 13 Jan 2017, at 10:12 AM, mailte...@gmail.com wrote: > > Hello, > > Have been struggling with mitigating against nil pointer deference and > i would appreciate if anyone can help > > Code 1: Works file > https://play.golang.org/p/lhOh9g5R9l > > > Code 2: Error > https://pl

[go-nuts] Re: Disadvantage of Go

2017-01-13 Thread hui zhang
I just list A B C D E F as an example. In real project we will use struct in struct . when the struct goes deeper, and it may be managed by other people, if the deepest struct need a default value. F{x:1} The upper struct user "must" known the detail. here below I just figure out a way below t

Re: [go-nuts] Disadvantage of Go

2017-01-13 Thread Michael Jones
One minor point is that you cannot fake the ternary operator with a function. In the function call the two alternates are evaluated before the call so this breaks I = (k==3) ? a++ : b++ and everything else with side effects such as function calls. On Fri, Jan 13, 2017 at 2:00 AM Egon wrote: >

Re: [go-nuts] Disadvantage of Go

2017-01-13 Thread hui zhang
Yes , cycle import is a bad design. But as the software becomes larger , not everything is controllable. In real project , some times it is a great risk to do refactor. 在 2017年1月13日星期五 UTC+8下午5:56:48,rog写道: > > On 13 January 2017 at 07:44, hui zhang > > wrote: > > 4 Can not Cycle import. > >

Re: [go-nuts] Re: Disadvantage of Go

2017-01-13 Thread 'Axel Wagner' via golang-nuts
If your struct need special initialization, provide a factory function (search for New* or Make* for examples) and don't export the special fields. If not, the zero value is obviously fine. Recursive application of this simple and widely used rule negates the problem you seem to be having; F appar

Re: [go-nuts] Disadvantage of Go

2017-01-13 Thread Ian Lance Taylor
On Fri, Jan 13, 2017 at 6:47 AM, hui zhang wrote: > Yes , cycle import is a bad design. > But as the software becomes larger , not everything is controllable. > In real project , some times it is a great risk to do refactor. Go is careful to initialize values in the correct order, such that if

[go-nuts] SSH Server maximum number of attempts

2017-01-13 Thread John Shahid
Hi all, I was wondering if there is a way to limit the maximum number of failed authentication attempts in an ssh server. looks like the serverAuthenticate method won’t exit unless the authenticatio

[go-nuts] Re: [gomobile] Is it possible to call my own ObjC code from Go using reverse binding?

2017-01-13 Thread Elias Naur
On Friday, January 13, 2017 at 2:26:11 PM UTC+1, nik.ku...@gmail.com wrote: > > Hello, everyone! As I know gomobile now supports reverse binding for ObjC > (thanks @elisnaur). I'd like to know - is it working only for system > modules or I can use it to call my own ObjC code from go as well? >

[go-nuts] Re: How do you mitigate against nil pointer dereference

2017-01-13 Thread mailteety
Hello, Thanks for the response. The Major Issue is that am getting the Data from *json *and its inconsistent. Regards Teety On Friday, 13 January 2017 14:41:02 UTC+1, mhh...@gmail.com wrote: > > Hi, > > some simple leads, > > Use one line initialization of Person > p := &Person{Attr:&Attribute{

Re: [go-nuts] How do you mitigate against nil pointer dereference

2017-01-13 Thread mailteety
Hello, Ignoring the error does not help https://play.golang.org/p/a8AIcHWII6 Thank you. On Friday, 13 January 2017 15:38:45 UTC+1, Ian Davis wrote: > > On Fri, 13 Jan 2017, at 10:12 AM, mail...@gmail.com wrote: > > > Hello, > > Have been struggling with mitigating against nil pointer defere

Re: [go-nuts] How do you mitigate against nil pointer dereference

2017-01-13 Thread mhhcbon
you could also implment unmarshaler interface https://blog.gopheracademy.com/advent-2016/advanced-encoding-decoding/ On Friday, January 13, 2017 at 6:18:01 PM UTC+1, mail...@gmail.com wrote: > > > Hello, > > Ignoring the error does not help > > https://play.golang.org/p/a8AIcHWII6 > > Thank yo

Re: [go-nuts] How do you mitigate against nil pointer dereference

2017-01-13 Thread mailteety
Can you give example how this validation can be done via such interface ? On Friday, 13 January 2017 18:27:51 UTC+1, mhh...@gmail.com wrote: > > you could also implment unmarshaler interface > > https://blog.gopheracademy.com/advent-2016/advanced-encoding-decoding/ > > > > On Friday, January 13,

Re: [go-nuts] SSH Server maximum number of attempts

2017-01-13 Thread Shawn Milochik
How about installing fail2ban? That's its job, and it does it well. -- 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

[go-nuts] Remote address in SSH DialTCP must be IP address

2017-01-13 Thread tgrosinger
In the crypto/ssh package, the DialTCP function requires that the remote address be presented as a TCPAddr. See https://github.com/golang/crypto/blob/master/ssh/tcpip.go#L324 This means the remote address must be an IP address and port combination, domain names are not possible. The specificati

Re: [go-nuts] How do you mitigate against nil pointer dereference

2017-01-13 Thread Ian Davis
On Fri, 13 Jan 2017, at 05:17 PM, mailte...@gmail.com wrote: > > Hello, > > Ignoring the error does not help > > https://play.golang.org/p/a8AIcHWII6 You changed your code by making your JSON valid so this is now a different problem to the one you originally asked. You can tak

Re: [go-nuts] Re: State of the database drivers in go

2017-01-13 Thread Daniel Theophanes
If you are using database/sql in a fresh project, I highly recommend starting on go1.8 (the first release candidate is out now). Also, if you encounter fundamental blocking issues with the database/sql package, please send a message to: https://groups.google.com/forum/#!forum/golang-sql Thanks,

Re: [go-nuts] How do you mitigate against nil pointer dereference

2017-01-13 Thread mhhcbon
yeah, right, it s possible and works, but its way more complex, lets forget about this :) This works https://play.golang.org/p/hP8Zq-LfQA On Friday, January 13, 2017 at 6:42:25 PM UTC+1, mail...@gmail.com wrote: > > > Can you give example how this validation can be done via such interface ? > >

[go-nuts] Re: Disadvantage of Go

2017-01-13 Thread 'simon place' via golang-nuts
sorry but for me, excepting generics and maybe a float32 maths lib, these are all just your problem. particularly wrong is the idea of native conversion of bools to/from numbers, albeit widespread and long-standing, perpetuating these mistakes just means preventing any development of languages.

Re: [go-nuts] Disadvantage of Go

2017-01-13 Thread Jesper Louis Andersen
For 2, out of curiosity. What is wrong with the following code using math.MaxUint32 for instance: https://play.golang.org/p/pPFvo1pOlc math defines a constant, which you will need to assign to an variable. But I don't see there being any type conversion in this piece of code. It is all implicit o

[go-nuts] Remote address in SSH DialTCP must be IP address

2017-01-13 Thread Dave Cheney
I'm pretty sure you can use the Dial method above, DialTCP was added to avoid using the DNS server at the remote end (I think, it's been years) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving ema

Re: [go-nuts] Disadvantage of Go

2017-01-13 Thread howardcshaw
Ehrmm, well, you can do that. The bit that you can't do without it being implemented in language is having it behave as a properly type-safe expression all the way through. Here is an example of a ternary function and its use that correctly triggers side-effects down only its true path and neve

[go-nuts] Re: Go cross compilation for Xtensa

2017-01-13 Thread Paulo Coutinho
Any evolution here? Do you deploy anything using it? Thanks. On Monday, April 20, 2015 at 12:15:39 PM UTC-3, k.ja...@gmail.com wrote: > > I tried building crosstool-NG with golang enabled. Now I have xtensa-gccgo > tool. Need to figure it out how to use it. > -- You received this message

[go-nuts] Re: Disadvantage of Go

2017-01-13 Thread Yu Liu
Agree. Only generics missing is disadvantage of Go. Yu On Friday, January 13, 2017 at 10:56:07 AM UTC-8, simon place wrote: > sorry but for me, excepting generics and maybe a float32 maths lib, these > are all just your problem. > > particularly wrong is the idea of native conversion of bools