[go-nuts] Re: Go -> C++ transpiler idea: Miracle child or horrible abomination?

2017-04-03 Thread leandro . pereira
Brad, On Friday, March 24, 2017 at 8:32:20 PM UTC-7, Brad wrote: > > Interested in any feedback about the idea of making a Go -> C++ > transpiler. Here's the rationale: > (...) > Assuming this actually worked, it might considerably lower the bar for > adopting Go, and allow it to be used to

Re: [go-nuts] Need help on go1.8 cgo compilation error

2017-04-03 Thread Ian Lance Taylor
On Mon, Apr 3, 2017 at 7:20 PM, wrote: > The reason I think correct C type is used is because in the "winscard.h" C > header file, the expected type is LPSCARD_READERSTATE. > And , in the golang cgo code, i.e. scard_unix.go, the argument 3 is cast as >

Re: [go-nuts] Need help on go1.8 cgo compilation error

2017-04-03 Thread clashion
The reason I think correct C type is used is because in the "winscard.h" C header file, the expected type is LPSCARD_READERSTATE. And , in the golang cgo code, i.e. scard_unix.go, the argument 3 is cast as (C.LPSCARD_READERSTATE). *Further details (not sure if is useful): * I found that in

Re: [go-nuts] Need help on go1.8 cgo compilation error

2017-04-03 Thread clashion
I think the correct C type is used. refer: https://github.com/ebfe/scard/blob/master/scard_unix.go Line 57: func scardGetStatusChange(ctx uintptr, timeout uint32, states []scardReaderState) Error { r := C.SCardGetStatusChange(C.SCARDCONTEXT(ctx), C.DWORD(timeout),

Re: [go-nuts] Need help on go1.8 cgo compilation error

2017-04-03 Thread Ian Lance Taylor
On Mon, Apr 3, 2017 at 5:53 PM, clashion wrote: > > I tried to compile the code from https://github.com/ebfe/scard . > > Error during compilation. > > > Environment: go1.8 , linux > > > Error Message: > > > cgo-gcc-prolog:198:2: warning: passing argument 3 of

Re: [go-nuts] Bots on the mailing list

2017-04-03 Thread Andrew Gerrand
As an experiment, I have banned those users from the group. They can mail us if they have questions about it, at which point we can ask them what the deal is with the forwarding. I doubt we will hear from them. If anyone sees other addresses doing this, let me know. Andrew On 3 March 2017 at

Re: [go-nuts] Re: Save Documents in Database

2017-04-03 Thread Tomi Häsä
The Android app could have (almost) real-time collaboration with teams where team members can make word searches for all the documents in the server. All the documents probably get downloaded to the Android devices, so you can make word searches locally also. If I decide to allow images also

[go-nuts] Re: Gov1.8 failing to allocate bitmap

2017-04-03 Thread Chris Johnson
added here as well: https://github.com/golang/go/issues/19831 On Monday, April 3, 2017 at 1:57:57 PM UTC-7, Chris Johnson wrote: > > I'm playing with go v1.8 on an armv7 and found something odd. I can > compile, run, etc pure go programs, but when I try importing zeromq it > fails to run even

[go-nuts] Need help on go1.8 cgo compilation error

2017-04-03 Thread clashion
Hi, I tried to compile the code from https://github.com/ebfe/scard . Error during compilation. Environment: go1.8 , linux Error Message: *cgo-gcc-prolog:198:2: warning: passing argument 3 of ‘SCardGetStatusChange’ from incompatible pointer type [enabled by default]*

Re: [go-nuts] Re: Save Documents in Database

2017-04-03 Thread Kevin Powick
On Monday, 3 April 2017 18:22:40 UTC-5, John McKown wrote: > > On Mon, Apr 3, 2017 at 5:37 PM, Kevin Powick > wrote: > >> Why put the documents in a database on your server at all? Just store the >> document in the file system with a unique ID. >> > > ​FTS - Full Text

[go-nuts] Re: Unsure how best to structure my packages on github

2017-04-03 Thread Dave Cheney
IMO it's simpler to start with all you code in a single package and only break something out when you find three or more cases where the code could be reused. Some other markers I use to guide breaking the code up into separate packages are if you find you have written a significant amount of

Re: [go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-04-03 Thread Kevin Powick
On Monday, 3 April 2017 16:25:50 UTC-5, Axel Wagner wrote: > The idea that "sometimes" an API call will return values that "may" be >> helpful, or partially useful, is a recipe of disaster. >> > > This is even further from what anyone is suggesting, than the normal level > of

[go-nuts] Re: Unsure how best to structure my packages on github

2017-04-03 Thread Damien Whitten
Thanks Dave. I hear you about models not being their own package. If I read you correctly, and taking it to the extreme, all files in a micro-service belong in the same package, possibly bar 'main'. If all database access is related to the same 'problem area', it all belongs in the same

[go-nuts] Re: sql: please, guys, tell me I am doing it wrong.

2017-04-03 Thread ojucie
I was not aware of that library, but my problem is already solved. Thank you, Daniel. On Monday, April 3, 2017 at 12:46:37 PM UTC-3, Daniel Theophanes wrote: > > You're doing it wrong. > > You want: https://godoc.org/bitbucket.org/kardianos/table > > On Monday, April 3, 2017 at 5:51:04 AM UTC-7,

[go-nuts] Re: Save Documents in Database

2017-04-03 Thread Tomi Häsä
That is exactly what I was thinking. I could save the files as OpenDocument format, DocBook format, etc. in Android but in proprietary format in the database where no-one else is looking at except my server. If I use a known standard, like ODT, I actually may need to study a lot of hours to

Re: [go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-04-03 Thread 'Axel Wagner' via golang-nuts
(btw, I'm obviously still reading this thread :) Thanks for the replies) On Mon, Apr 3, 2017 at 11:25 PM, Axel Wagner wrote: > Hi, > > On Mon, Apr 3, 2017 at 11:02 PM, Kevin Powick wrote: > >> Check the error value. If an error is present, all

Re: [go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-04-03 Thread 'Axel Wagner' via golang-nuts
Hi, On Mon, Apr 3, 2017 at 11:02 PM, Kevin Powick wrote: > Check the error value. If an error is present, all bets are off with > regard to any of the return values. It's simple, explicit and consistent. > I've said it at least 5 times in this thread alone but: No one is

Re: [go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-04-03 Thread Caleb Spare
Hey Axel, this is a good question that I've thought about from time to time as well. It seems that most people in this thread have misunderstood it :) I personally agree with your preference as given in the examples just because I find the code easier to read when the error return is handled

[go-nuts] Unsure how best to structure my packages on github

2017-04-03 Thread Dave Cheney
I've always argued that a package's name is a one word elevator pitch for what it provides--not what it contains. Package models fails this tests because it enumerates the contents of the package. You could argue that this also provides the models for your project, but think about what

[go-nuts] Re: Save Documents in Database

2017-04-03 Thread Kevin Powick
Sounds like you're re-inventing a wheel that not only may be a lot of work, but will result in a proprietary format that is incompatible with everything. -- Kevin Powick On Monday, 3 April 2017 02:33:31 UTC-5, Tomi Häsä wrote: > > Because Go has structs and it can read for example XML and

Re: [go-nuts] Re: Go on Solaris 10 amd64

2017-04-03 Thread mi*ke
Ok, thanks for the clarification. That's what I needed. On Mon, Apr 3, 2017, 16:44 Aram Hăvărneanu wrote: > What's the question? > > Go works on Solaris 11 and later only (including illumos). It does not > work on Solaris 10 and likely never will because Solaris 10 lacks > event

Re: [go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-04-03 Thread Kevin Powick
I'm on Dave C.'s side with this one. Check the error value. If an error is present, all bets are off with regard to any of the return values. It's simple, explicit and consistent. The idea that "sometimes" an API call will return values that "may" be helpful, or partially useful, is a recipe

[go-nuts] Gov1.8 failing to allocate bitmap

2017-04-03 Thread plasticchris
I'm playing with go v1.8 on an armv7 and found something odd. I can compile, run, etc pure go programs, but when I try importing zeromq it fails to run even this: package main import ( zmq "github.com/pebbe/zmq4" "fmt" ) func main() { fmt.Println(zmq.Version()) } And I

Re: [go-nuts] Re: Go on Solaris 10 amd64

2017-04-03 Thread Aram Hăvărneanu
What's the question? Go works on Solaris 11 and later only (including illumos). It does not work on Solaris 10 and likely never will because Solaris 10 lacks event ports. -- Aram Hăvărneanu -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Unsure how best to structure my packages on github

2017-04-03 Thread Damien Whitten
Apologies if this has already been asked and answered, I'm not quite sure which incantation to put in the google box. In our organisation, we have many private and public go packages for various projects. For each micro-service, we structure it as: /cmd/{name}/{name}.go - something which

Re: [go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-04-03 Thread David Collier-Brown
A former customer made it a practice to always return properly initialized objects where others would return nul/null. Instead of exploding in dev, the programs merely behaved mysteriously at run-time. In a libray which called it, had to check everything I was passed for *meaningfullness*,

Re: [go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-04-03 Thread David Collier-Brown
A former customer made it a practice to always return properly initialized objects where others would return nul/null. Instead of exploding in dev, the programs merely behaved mysteriously at run-time. In a libray which called it, had to check everything I was passed for *meaningfullness*,

[go-nuts] Show Go-Nuts: A light, expressive Go HTTP handler.

2017-04-03 Thread Marwan abdel moneim
https://github.com/mrwnmonm/handler Do you like this expressive way to write handlers? Appreciate your feedback. -- 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

[go-nuts] Re: I'm stuck with function onEvict("key", t) used as value

2017-04-03 Thread Joubin Houshyar
Here you go: https://play.golang.org/p/zumvg2Bcyt For every type specific (k, v) tuple you'll need to create a evict func type converter. On Monday, April 3, 2017 at 10:44:16 AM UTC-4, Yaroslav Molochko wrote: > > In short, I'm trying to cast type of > function(string, sometype) ->

Re: [go-nuts] Is it harmful to always return invalid values on a non-nil-error?

2017-04-03 Thread 'Eric Johnson' via golang-nuts
My 2 cents: On Saturday, April 1, 2017 at 4:26:20 AM UTC-7, Axel Wagner wrote: > > Ian: > Re your question: See my example given above (or the one below, which is > probably more authentic). For example, you might be allocating the returned > struct, and piece by piece filling in the fields. If

Re: [go-nuts] [PSA] GopherCon Singapore 2017 schedule is out!

2017-04-03 Thread Nyah Check
I love the Ethereum for Go programmers talk. Will love to watch it on Youtube On Mon, Apr 3, 2017 at 4:00 PM, 'Luther Goh Lu Feng' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Talk details here! > > https://2017.gophercon.sg/talks/ > > -- > You received this message because you are

[go-nuts] Re: sql: please, guys, tell me I am doing it wrong.

2017-04-03 Thread Daniel Theophanes
You're doing it wrong. You want: https://godoc.org/bitbucket.org/kardianos/table On Monday, April 3, 2017 at 5:51:04 AM UTC-7, JuciÊ Andrade wrote: > > I built a little command line utility for running arbitrary sql queries. > You use it like: > > runQuery "select * from myTable" > > >

Re: [go-nuts] Re: Go on Solaris 10 amd64

2017-04-03 Thread c0psrul3
Wondering if you got anywhere with this? Noob trying to run make.bash, using (what appears to be) preferred bootstrap on Solaris. I'm heading toward cross-compiling toolchain, before attempting to build apps on Sol10u11, Sol11.3. What I'm reading here, however, is that each of those two

[go-nuts] [PSA] GopherCon Singapore 2017 schedule is out!

2017-04-03 Thread 'Luther Goh Lu Feng' via golang-nuts
Talk details here! https://2017.gophercon.sg/talks/ -- 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,

Re: [go-nuts] I'm stuck with function onEvict("key", t) used as value

2017-04-03 Thread Konstantin Khomoutov
On Sun, 2 Apr 2017 16:10:57 -0700 (PDT) ono...@gmail.com wrote: > In short, I'm trying to cast type of > function(string, sometype) -> function(interface{}, interface{}) > here is the code: > > https://play.golang.org/p/_ZCT8m_m_0 > > I've tried like 10 possible options, and I believe I just

[go-nuts] I'm stuck with function onEvict("key", t) used as value

2017-04-03 Thread onorua
In short, I'm trying to cast type of function(string, sometype) -> function(interface{}, interface{}) here is the code: https://play.golang.org/p/_ZCT8m_m_0 I've tried like 10 possible options, and I believe I just don't see something really simple, will highly appreciate some insights on how

Re: [go-nuts] sql: please, guys, tell me I am doing it wrong.

2017-04-03 Thread ojucie
Maybe surprisingly I can't use ellipsis at the call site because Scan expects pointers to values, not the values themselves. Using v... Scan returned an error: sql: Scan error on column index 0: destination not a pointer So, I changed v to contain pointer to values. Then it worked. v =

[go-nuts] Re: Best practice for Method Receivers

2017-04-03 Thread Val
It's a combination of : 1) A read and a write of a variable, happening without synchronization (see happens-before ), is always a race, and always a bug, even when it "looks" innocuous. 2) When the receiver of a method is not a pointer, then this receiver is

Re: [go-nuts] sql: please, guys, tell me I am doing it wrong.

2017-04-03 Thread Ayan George
On 04/03/2017 08:50 AM, oju...@gmail.com wrote: > I built a little command line utility for running arbitrary sql queries. > You use it like: > > runQuery "select * from myTable" > > > Previously I have build similar tools in C and Java and I don't remember > needing to code a hack to

[go-nuts] Save Documents in Database

2017-04-03 Thread Tomi Häsä
Because Go has structs and it can read for example XML and JSON, I have been thinking of making my own document format and save those documents to a database. Users would save the documents in my Android app as XML locally, but the documents will be saved in a more concise format inside an

Re: [go-nuts] Re: How to abort the http ResponseWriter

2017-04-03 Thread Sebastien Binet
Song Liu, On Mon, Apr 3, 2017 at 5:33 AM, Song Liu wrote: > Is there any other official way to cancel a ResponseWriter ? > > Many thanks. > > On Saturday, April 1, 2017 at 8:12:55 PM UTC+8, Song Liu wrote: >> >> >> I am implementing a file server, so http.ServerFile used to