[go-nuts] Today I discovered another std lib gem: strings.NewReplacer

2017-09-09 Thread DrGo
I needed to replace a specially coded tokens with their unicode representations. strings.NewReplacer made it clean and easy. first, you pass to strings.NewReplacer a string array literal made up of old, new string pairs, like so var logicalReplacer = strings.NewReplacer( "%and", `∧`,

[go-nuts] Today, I discovered a std library gem: strings.NewReplacer

2017-09-09 Thread DrGo
I needed to replace a specially coded tokens with their unicode representations. strings.NewReplacer made it clean and easy. first, you pass to strings.NewReplacer a string array literal made up of old, new string pairs, like so var logicalReplacer = strings.NewReplacer( "%and", `∧`,

[go-nuts] Re: how to get the SQL Dataframe into GOTA

2017-09-09 Thread Vikram Rawat
Please if anybody knows how to do it. Even by writing a big function I am ready to do it. Can anybody please help me?? -- 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

Re: [go-nuts] Re: Do you guys use ORMs when working with SQL?

2017-09-09 Thread Shawn Milochik
In my opinion, ORMs are worse than useless. You need to know SQL to use an ORM. So if you use an ORM, you must bear in mind the underlying SQL *and* know the syntax of the ORM. Using an ORM "saves" you from writing some boilerplate code, but then you have to write ORM-specific boilerplate code,

Re: [go-nuts] Choosing a framework

2017-09-09 Thread Shawn Milochik
This topic has been discussed many times on this list. Do a search and you'll see a lot of great points. My opinion is that you should use the standard library, and only reach for individual components when it would provide a significant advantage. Do not use any "framework." Like Go's

[go-nuts] Re: Do you guys use ORMs when working with SQL?

2017-09-09 Thread Tim Uckun
Wow. the amazing amount of projects mentioned in this thread are interesting. Surprised that by now there isn't a well established leader or leaders for such a common need. On Sunday, September 10, 2017 at 10:01:51 AM UTC+12, Denis Isaev wrote: > > Take a look at kallax

[go-nuts] Help with viper please.

2017-09-09 Thread Tim Uckun
I have this code v := viper.New() v.SetConfigFile("settings.yaml") v.AddConfigPath(".") v.AddConfigPath("./settings") v.AddConfigPath("./config") err := v.ReadInConfig() if err != nil { panic(fmt.Errorf("Error when reading config: %v\n", err)) } if as the instructions say I don't

Re: [go-nuts] Choosing a framework

2017-09-09 Thread Rodolfo
https://echo.labstack.com/ 2017-09-09 19:51 GMT-04:00 Tim Uckun : > I am in the process of learning go and decided to do it by writing a > (mostly) API based web site. I have been doing some research and have found > the following. > > Revel: https://revel.github.io/ >

[go-nuts] Choosing a framework

2017-09-09 Thread Tim Uckun
I am in the process of learning go and decided to do it by writing a (mostly) API based web site. I have been doing some research and have found the following. Revel: https://revel.github.io/ GoBuffalo: https://gobuffalo.io/ Iris: https://iris-go.com/ In addition there are "toolkits" like chi

[go-nuts] Re: Do you guys use ORMs when working with SQL?

2017-09-09 Thread main . iden
Take a look at kallax and queryset . They are modern typesafe ORMs, allowing to write safe and reusable code. среда, 28 декабря 2016 г., 1:00:05 UTC+3 пользователь Zippoxer написал: > > I haven't written SQL for years.

Re: [go-nuts] Testing on Go templates Range's index

2017-09-09 Thread Jan Mercl
On Sat, Sep 9, 2017 at 6:01 PM Tong Sun wrote: As documented , ne is a function, not an infix operator: https://play.golang.org/p/sJSzoNyrJz -- -j -- You received this message because you are subscribed to the

[go-nuts] Testing on Go templates Range's index

2017-09-09 Thread Tong Sun
Hi, If I have Go templates Range declared like this, {{range $i, $x := $.People}} How can I test its index value? I thought it should be `{{if $i ne 0}}` but it is not working for me: https://play.golang.org/p/NB10G1CjBr I've also tried `{{if $i ne "0"}}`, but that failed on me as well.

[go-nuts] Re: bufio.Writer and timeouts

2017-09-09 Thread Juliusz Chroboczek
> bufio.Writer is about 200 lines, and you probably don't even need all > of them. Just copy it and modify it for your purposes. Ok, thanks. -- Juliusz -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

Re: [go-nuts] bufio.Writer and timeouts

2017-09-09 Thread Ian Lance Taylor
On Sat, Sep 9, 2017 at 7:39 AM, Juliusz Chroboczek wrote: > > I've got a bufio.Writer which is wrapping a net.TCPConn. Once in > a while, Flush() will trigger a write timeout (set with SetWriteDeadline > on the underlying connection), in which case I'd like to reschedule some >

[go-nuts] bufio.Writer and timeouts

2017-09-09 Thread Juliusz Chroboczek
Hi, I've got a bufio.Writer which is wrapping a net.TCPConn. Once in a while, Flush() will trigger a write timeout (set with SetWriteDeadline on the underlying connection), in which case I'd like to reschedule some requests on a different connection, and then restart the Flush() with a more

[go-nuts] how to get the SQL Dataframe into GOTA

2017-09-09 Thread Vikram Rawat
can anybody help me out with it. I want to get this data into GOTA Dataframe. I just can't figure out how to get the data from SQL into GOTA