[go-nuts] Re: database / sql transaction error handling questions

2018-01-10 Thread Tamás Gulácsi
2018. január 10., szerda 8:05:18 UTC+1 időpontban evan a következőt írta: > > after reading https://golang.org/pkg/database/sql/, i'm still not quite > sure how to do error handling with respect to tx (transaction) operations. > coming from a java/c# background, where once an exception is raised,

Re: [go-nuts] New identifiers and selectors in short variable declarations

2018-01-10 Thread Jan Mercl
On Tue, Jan 9, 2018 at 10:08 PM Jim Bishopp wrote: > Has there ever been a discussion about allowing new identifiers and selectors in short variable declarations? FTR: There are other things that are legal on the LHS of an assignment, but not in the short variable declaration, like x[i], *x, *f(

[go-nuts] Re: database / sql transaction error handling questions

2018-01-10 Thread evan
thanks for the detailed response. -- 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://grou

Re: [go-nuts] http.FileServer: how to serve static files requested from different domains?

2018-01-10 Thread Ayan George
On 01/09/2018 02:34 PM, Andy Balholm wrote: > Try: > > http.Handle(“domain1.com/assets/", http.StripPrefix("/", > http.FileServer(http.Dir(*webrootdomain1 > http.Handle(“domain2.com/assets/", http.StripPrefix("/", > http.FileServer(http.Dir(*webrootdomain2 > Wow! Reading is fundament

[go-nuts] error: incompatible types in binary expression

2018-01-10 Thread pradam
Hi Gophers, I am a newbie to golang, I have been working on this snippet for a while whenever i run this snippet I am getting above error message. I am actual searched on google but i didn't get any proper solution with an explanation.help me with it. package main import ( "fmt" ) func p

Re: [go-nuts] error: incompatible types in binary expression

2018-01-10 Thread Jan Mercl
On Wed, Jan 10, 2018 at 2:29 PM pradam wrote: > I am a newbie to golang, I have been working on this snippet for a while whenever i run this snippet I am getting above error message. > I am actual searched on google but i didn't get any proper solution with an explanation.help me with it. 'v :=

[go-nuts] Mosquitto auth plugin

2018-01-10 Thread Ignacio Gómez
Hi, guys. I've recently written an authentication/authorization plugin for mosquitto, a well known open-source MQTT broker, using cgo. The basic idea was to export some Go functions to mosquitto's C plugin interface, and write all the logic in Go. It implements a bunch of backends available, an

Re: [go-nuts] Using database/sql in a web application

2018-01-10 Thread Manlio Perillo
Il giorno venerdì 5 gennaio 2018 18:09:40 UTC+1, Chris Hopkins ha scritto: > > Why not use an interface? > type TableSaver func (db *DB) > or > type TableSaver func (tx *Tx) // depending on your needs > > > Allowing you to: > func (t *Table) SaveTable (...) {} > > > Which in your example if you w

[go-nuts] [ANN] Graph database

2018-01-10 Thread Luis Furquim
Hello Gophers, Just announcing my graph database called Linsang. It operates in embedded way. No server/daemon. It has a main package which just defines the basis. But the linsangmysql subpackage implementing the operations has most of the code (and so the documentation). I divided this way to all

[go-nuts] Map with multiple "indexes"

2018-01-10 Thread lee
I'm trying to come up with a data structure that I can search for map values quickly without having to iterate an entire (and large) map to find a value. Essentially I have a map that contains lots of data and the key is the primary identifier where most of the lookups go to. This is very quic

Re: [go-nuts] Map with multiple "indexes"

2018-01-10 Thread Burak Serdar
On Wed, Jan 10, 2018 at 7:57 AM, wrote: > I'm trying to come up with a data structure that I can search for map values > quickly without having to iterate an entire (and large) map to find a value. > > Essentially I have a map that contains lots of data and the key is the > primary identifier whe

Re: [go-nuts] Map with multiple "indexes"

2018-01-10 Thread lee
Of course! Thank you! I mocked up a full working example here: https://play.golang.org/p/OUtbbAbbUF1 Any idea though how I would keep deletions in sync though? On Wednesday, January 10, 2018 at 3:24:37 PM UTC, Burak Serdar wrote: > > On Wed, Jan 10, 2018 at 7:57 AM, > > wrote: > > I'm tryin

Re: [go-nuts] Map with multiple "indexes"

2018-01-10 Thread Burak Serdar
On Wed, Jan 10, 2018 at 8:30 AM, wrote: > Of course! Thank you! > > I mocked up a full working example here: > https://play.golang.org/p/OUtbbAbbUF1 > > Any idea though how I would keep deletions in sync though? func (m SomeStructMap) DeleteByF1(s string) { if v, ok:=m.f1Map[s]; ok { del

Re: [go-nuts] [ANN] Graph database

2018-01-10 Thread Tharaneedharan Vilwanathan
Hi, Did you forget to provide the link? Thanks dharani On Wed, Jan 10, 2018 at 6:36 AM, Luis Furquim wrote: > Hello Gophers, > > Just announcing my graph database called Linsang. It operates in embedded > way. No server/daemon. It has a main package which just defines the basis. > But the lin

Re: [go-nuts] [ANN] Graph database

2018-01-10 Thread Luis Furquim
Hi, YES, sorry! I forgot! :( github.com/luisfurquim/linsang Thanks! Luis Otavio de Colla Furquim Em qua, 10 de jan de 2018 às 16:13, Tharaneedharan Vilwanathan < vdhar...@gmail.com> escreveu: > Hi, > > Did you forget to provide the link? > > Thanks > dharani > > > On Wed, Jan 10, 2018 at 6:36

[go-nuts] Re: Connecting to Google Cloud Storage

2018-01-10 Thread arunnediyasala
> Hi all, > I want to connect my digi XBee to google cloud is there is any way to do that please help me on this .DIGI XBee gateway is by default connecting to the digi data cloud so that all the data is going to the digi cloud .I want to connect to google cloud -- You received this messag

[go-nuts] Is there an equivalent of telldir in go. If not what are the alternatives?

2018-01-10 Thread Amandeep Gautam
Is there a equivalent of telldir in golang which can page reading of a directory. Just using filepath.walk would be inefficient for large file systems. >From one of the answers to this question https://stackoverflow.com/questions/39583522/how-do-i-use-seekdir-telldir-in-golang it looks like ther

Re: [go-nuts] Is there an equivalent of telldir in go. If not what are the alternatives?

2018-01-10 Thread Ian Lance Taylor
On Wed, Jan 10, 2018 at 3:31 PM, Amandeep Gautam wrote: > > Is there a equivalent of telldir in golang which can page reading of a > directory. > Just using filepath.walk would be inefficient for large file systems. There is no telldir, but you can simply call the `Readdir` (or `Readdirnames`) me

[go-nuts] dependency repo internal mirroring/hosting

2018-01-10 Thread Sangjin Lee
What do folks do in terms of managing/vetting dependencies and also hosting them internally? In other language ecosystems, there are tools such as Nexus or Artifactory that work as caching mirrors for binary dependencies. That way, a company or a team can have a stronger control/governance on d

[go-nuts] Micali 'algorand' in go?

2018-01-10 Thread Pat Farrell
Anyone working on this? Would seem to be a natural thing to implement in go. He has published papers talking about a C++ implementation, but I've done more than enough C++ in my lifetime. If there is no existing effort, is there any interest in joining me in one? -- You received this message b

Re: [go-nuts] Micali 'algorand' in go?

2018-01-10 Thread Michael Jones
To save others the Google Search: https://people.csail.mit.edu/nickolai/papers/gilad-algorand-eprint.pdf On Wed, Jan 10, 2018 at 4:59 PM, Pat Farrell wrote: > Anyone working on this? Would seem to be a natural thing to implement in > go. He has published papers talking about a C++ implementatio

Re: [go-nuts] Is there an equivalent of telldir in go. If not what are the alternatives?

2018-01-10 Thread Michael Jones
...also, i have a parallel file walker that's 10x+ faster. https://github.com/MichaelTJones On Wed, Jan 10, 2018 at 4:07 PM, Ian Lance Taylor wrote: > On Wed, Jan 10, 2018 at 3:31 PM, Amandeep Gautam > wrote: > > > > Is there a equivalent of telldir in golang which can page reading of a > > di

Re: [go-nuts] Is there an equivalent of telldir in go. If not what are the alternatives?

2018-01-10 Thread Bakul Shah
On Wed, 10 Jan 2018 15:31:26 -0800 Amandeep Gautam wrote: Amandeep Gautam writes: > > Is there a equivalent of telldir in golang which can page reading of a > directory. > Just using filepath.walk would be inefficient for large file systems. > > >From one of the answers to this question > http

Re: [go-nuts] error: incompatible types in binary expression

2018-01-10 Thread pradam
Thank you, Jan Merci, it was very helpful. On Wed, Jan 10, 2018 at 7:05 PM, Jan Mercl <0xj...@gmail.com> wrote: > On Wed, Jan 10, 2018 at 2:29 PM pradam > wrote: > > > I am a newbie to golang, I have been working on this snippet for a while > whenever i run this snippet I am getting above error

[go-nuts] interaction of defer and named returns is too subtle and non-local

2018-01-10 Thread 'Eric Johnson' via golang-nuts
I was looking at fixing an issue flagged by gometalinter, and realized I didn't understand the actual behavior of defer statements. Specifically, I was not handling the error return of a close operation. I wrote a test program so I could understand the behavior, which led to these two function

[go-nuts] Re: Map with multiple "indexes"

2018-01-10 Thread lee
Perfect thank you! On Wednesday, January 10, 2018 at 2:58:34 PM UTC, Lee Armstrong wrote: > > I'm trying to come up with a data structure that I can search for map > values quickly without having to iterate an entire (and large) map to find > a value. > > Essentially I have a map that contains l

[go-nuts] interaction of defer and named returns is too subtle and non-local

2018-01-10 Thread Dave Cheney
> The body of the two functions differs only by a single ":", and yet, the > output of the Printf calls differs. This is not correct. The significant difference is one version has a named return value, the other does not. The named return value allows you to capture (by name) the return value a

Re: [go-nuts] interaction of defer and named returns is too subtle and non-local

2018-01-10 Thread 'Axel Wagner' via golang-nuts
On Thu, Jan 11, 2018 at 8:10 AM, 'Eric Johnson' via golang-nuts < golang-nuts@googlegroups.com> wrote: > I was looking at fixing an issue flagged by gometalinter, and realized I > didn't understand the actual behavior of defer statements. Specifically, I > was not handling the error return of a cl