Re: [go-nuts] Re: http response issue with leaking handles

2016-07-28 Thread krmayankk
Thanks James, are there any golang tools which could have caught this issue. I know go vet didnt. On Thursday, July 28, 2016 at 1:36:04 PM UTC-7, James Bardin wrote: > > > > On Thursday, July 28, 2016 at 2:34:24 PM UTC-4, krma...@gmail.com wrote: >> >> WHere is this documented in "On error, any

[go-nuts] How do i create a fake drive that shows up in windows explorer?

2016-07-28 Thread Tamás Gulácsi
I'd write it as a FUSE fs, with https://bazil.org/fuse/, then adapt it to Windows with https://dokan-dev.github.io/ . -- 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

Re: [go-nuts] wired value

2016-07-28 Thread Chris Manghane
A simple example: https://play.golang.org/p/RNgW-Ya5BS Conversions between numeric types : "For the conversion of non-constant numeric values, the following rules apply: 1. When converting between integer types, if the value is a signed integer, it i

Re: [go-nuts] post method in golang?

2016-07-28 Thread Chris Broadfoot
Try this awesome utility: https://mholt.github.io/curl-to-go/ On Jul 28, 2016 8:47 PM, "Adrian Lanzafame" wrote: > Hi Victor, > > Have you had a look at the net/http package? > http://golang.org/pkg/net/http > > On Fri, 29 Jul 2016 01:01 Victor L wrote: > >> I am using curl for REST call from j

[go-nuts] [ANN] gocraft/work - background job processing backed by Redis

2016-07-28 Thread jnovak
gocraft/work lets you enqueue and processes background jobs in Go. Jobs are durable and backed by Redis. Very similar to Sidekiq for Go. It's quite fast -- easily process over 20k jobs/sec per host. I benchmarked a

[go-nuts] wired value

2016-07-28 Thread belrhalmia . walid
Hello everybody, can someone explain me this weird value : this return me this value: -9223372036854775808 fmt.Println(int(math.Pow(float64(9200), float64(5 Normally 9200^5 musnt give this value even if i put a value bigger then 9200 i receive the same value please can someone explain me w

Re: [go-nuts] post method in golang?

2016-07-28 Thread Adrian Lanzafame
Hi Victor, Have you had a look at the net/http package? http://golang.org/pkg/net/http On Fri, 29 Jul 2016 01:01 Victor L wrote: > I am using curl for REST call from json file, like the following: > curl -X POST -H "Content-Type: application/json" > http://127.0.0.1:8080/v2/apps?force=true -d.

[go-nuts] Compiling C files conditionally

2016-07-28 Thread satyam
Hi Folks, If I need to compile c files in a package conditionally based on the OS that I am running on, seems like +build is the right way to do it. I can have two versions of the file: somefile_linux.go which has // +build linux and also an import "C" and somefile_nonlinux.go which has //

Re: [go-nuts] How do i create a fake drive that shows up in windows explorer?

2016-07-28 Thread Tim Hawkins
Look at FUSE, its a userland filesystem driver system. https://github.com/hanwen/go-fuse On 29 Jul 2016 7:31 a.m., "Justin C" wrote: > Good afternoon, > I am trying to create a fake (virtual?) drive that would display a > programmatic generated file system tree that when the user clicks on a fi

[go-nuts] Re: How do i create a fake drive that shows up in windows explorer?

2016-07-28 Thread brainman
I do not know how to build what you want - Go or not Go. I suspect you would have to use some low level tools to build something like that. Perhaps you should ask this question somewhere where more Windows programmers hangout. Maybe try posting this (without mentioning Go) on http://stackoverfl

[go-nuts] Re: Who wants to use Go to process your camera's raw files?

2016-07-28 Thread Guy Allard
If you put something up on github, please let us know here. On Tuesday, July 26, 2016 at 10:36:31 PM UTC-4, Jonathan Pittman wrote: > > Well me too! I am looking to see what level of interest there is in the > Go community to see this happen. I am also looking for people who are > interested

[go-nuts] Re: What lead to the versionning debate?

2016-07-28 Thread Dave Cheney
Yes, to use the vendor/ feature project authors need to flatten all their dependencies into a single, top level, vendor/ folder. This is currently difficult as there is no common way to look at two copies of the same source code and decode if there are the same, and if not, which should take pri

[go-nuts] Re: What lead to the versionning debate?

2016-07-28 Thread Chad
My reasoning was flawed. (also, I generally mean "one" when I use "we" :) I think you're right with the project based approach in gb (for people interested in reproducible builds). I think that the pkg path issue (that leads to type equality issue) may be simply solved by having the vendor dire

[go-nuts] Re: What lead to the versionning debate?

2016-07-28 Thread Tyler Compton
It's funny that you mention libraries using vendoring because that's been a big deal surrounding this topic. https://groups.google.com/d/msg/golang-dev/4FfTBfN2YaI/WCza__MaCgAJ On Thursday, July 28, 2016 at 4:15:06 PM UTC-7, Chad wrote: > > Actually, nevermind. I was thinking about libraries usi

[go-nuts] Re: What lead to the versionning debate?

2016-07-28 Thread Dave Cheney
Who is we ? You and me ? On Friday, 29 July 2016 08:50:47 UTC+10, Chad wrote: > > So if we decided that vendoring always used HEAD, that would ideally force > people to have stable APIs (plus, why vendor an unstable/ in-flight API > anyway) > > Couldn't it enable a change of behaviour for go get

Re: [go-nuts] weired value

2016-07-28 Thread Matt Harden
The large value overflows the range of an int and so it "wraps around" to a negative number. On Thu, Jul 28, 2016 at 4:01 PM WALID BELRHALMIA wrote: > Hello everybody still learning Go i remark a weired think, > > this command : fmt.Println(int(math.Pow(float64(9200), float64(5 > > Return :

[go-nuts] How do i create a fake drive that shows up in windows explorer?

2016-07-28 Thread Justin C
Good afternoon, I am trying to create a fake (virtual?) drive that would display a programmatic generated file system tree that when the user clicks on a file in internet explore it opens the file but could first run operations on that file like log that it was opened or even de-crypt the file a

[go-nuts] Re: What lead to the versionning debate?

2016-07-28 Thread Chad
Actually, nevermind. I was thinking about libraries using vendoring. But that's probably a misuse. On Friday, July 29, 2016 at 12:50:47 AM UTC+2, Chad wrote: > > So if we decided that vendoring always used HEAD, that would ideally force > people to have stable APIs (plus, why vendor an unstable/

[go-nuts] weired value

2016-07-28 Thread WALID BELRHALMIA
Hello everybody still learning Go i remark a weired think, this command : fmt.Println(int(math.Pow(float64(9200), float64(5 Return : -9223372036854775808 i don't know why normally 9200⁵ is a positive big value can some one explain me this please in details ? -- You received this me

[go-nuts] Re: What lead to the versionning debate?

2016-07-28 Thread Chad
So if we decided that vendoring always used HEAD, that would ideally force people to have stable APIs (plus, why vendor an unstable/ in-flight API anyway) Couldn't it enable a change of behaviour for go get when a vendor directory is detected and solve some of the issues related to type equalit

[go-nuts] Re: recommended push notification library for Go

2016-07-28 Thread Hotei
Depending on your needs (you didn't specify the target mobile devices) you can use go's SMTP facilities to send an email to a phone via an SMS gateway. This list might help though I'm not sure how current it is. http://mfitzp.io/list-of-email-to-sms-gateways/ On Thursday, July 28, 2016 at 3:1

[go-nuts] Re: ANNOUNCE: gini

2016-07-28 Thread Justin Israel
Neat. I had been using pigosat for a project. It vendors the picosat C dependency right in. Cool to see a pure Go solution. Justin On Sunday, July 24, 2016 at 9:33:31 AM UTC+12, Scott Cotton wrote: > > I'm happy to announce the first public beta release o

[go-nuts] Re: What lead to the versionning debate?

2016-07-28 Thread Dave Cheney
Yes, exactly. -- 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://groups.google.com/d/optou

[go-nuts] Re: What lead to the versionning debate?

2016-07-28 Thread Chad
Hi Dave, Thank you for the link. >From the discussions I have seen so far, it seems to me that there is a conflation between the notions of version and revision. The go tooling AND language remains unaware of revisions indeed, which would be the role of the source control system (often git now

[go-nuts] Will too many cases in a select block affect program efficiency much?

2016-07-28 Thread Dave Cheney
How many case blocks are you considering? There is some setup cost that is linear with the number of selectable channels, but as a select stmt usually blocks the setup cost is not usually considered the limiting factor. -- You received this message because you are subscribed to the Google Grou

[go-nuts] What lead to the versionning debate?

2016-07-28 Thread Dave Cheney
Hello, You're pretty late to the discussion. Here's some background reading. https://getgb.io/rationale/ Dave -- 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] What lead to the versionning debate?

2016-07-28 Thread Chad
Just wondering, Because as of now, in Go, the Pkg path is the version and for reproducible builds, your source/version control is probably more suited to handle the task. Or are there drawbacks to that? -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Re: http response issue with leaking handles

2016-07-28 Thread James Bardin
On Thursday, July 28, 2016 at 2:34:24 PM UTC-4, krma...@gmail.com wrote: > > WHere is this documented in "On error, any Response can be ignored. A > non-nil Response with a non-nil error only occurs when CheckRedirect fails, > and even then the returned Response.Body is already closed" > > I am

[go-nuts] recommended push notification library for Go

2016-07-28 Thread Karthik Rajagopalan
Hi Folks, I am looking for a library which can be integrated with backend server written in Go to handle push notification to mobile devices. Can you folks share your experience on available options for Go? -Karthik -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Re: http response issue with leaking handles

2016-07-28 Thread krmayankk
WHere is this documented in "On error, any Response can be ignored. A non-nil Response with a non-nil error only occurs when CheckRedirect fails, and even then the returned Response.Body is already closed" I am interested in looking at it. I didnt find it here https://golang.org/pkg/net/http/

[go-nuts] Re: Speeding up multiple regexp matches

2016-07-28 Thread gtownsend
A couple of years ago I worked on a project, in Go, to parse multiple regular expressions into a single DFA (state machine). There's a demo website at regex.cs.arizona.edu The source code for everything (website + underlying library) is on GitHub at github.com/proebsting/re Gregg Townse

Re: [go-nuts] pprof where is my time going

2016-07-28 Thread ajay aggarwal
Apparently its very easy to collect execution tracer profile runtime.trace.Start (io.Writer) time.Sleep(N seconds) runtime.trace.Stop() And to analyze/look at the collected profile go tool trace /path/to/your/app/executable On Monday, July 25, 2016 at 5:47:19 PM UTC-4, ajay aggarwal wrote:

[go-nuts] Will too many cases in a select block affect program efficiency much?

2016-07-28 Thread T L
I haven't read golang src on how to implement select, but I feel it would be much complicated. Is there many push-into-queue and leave-queue actions? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receivin

Re: [go-nuts] Re: http response issue with leaking handles

2016-07-28 Thread James Bardin
On Thu, Jul 28, 2016 at 11:08 AM, Ian Davis wrote: > Great. Very clear. > > To those looking for this: it's a new comment added after 1.6.2 > Thanks, forgot I was on master. Yes, this was implied by the error handling example in the docs, but now is much more explicit. -- You received this me

Re: [go-nuts] Re: http response issue with leaking handles

2016-07-28 Thread Ian Davis
On Thu, Jul 28, 2016, at 03:50 PM, James Bardin wrote: > > On Thu, Jul 28, 2016 at 10:39 AM, Ian Davis wrote: >> Is it? The http package only says: >> >> "When err is nil, resp always contains a non-nil resp.Body. Caller >> should close resp.Body when done reading from it." >> >> It doesn't say

[go-nuts] post method in golang?

2016-07-28 Thread Victor L
I am using curl for REST call from json file, like the following: curl -X POST -H "Content-Type: application/json" http://127.0.0.1:8080/v2/apps?force=true -d...@deploy.json How can I translate this to "golang" POST method? More specifically, how can i create request object from json file? Thanks

Re: [go-nuts] Re: http response issue with leaking handles

2016-07-28 Thread James Bardin
On Thu, Jul 28, 2016 at 10:39 AM, Ian Davis wrote: > Is it? The http package only says: > > "When err is nil, resp always contains a non-nil resp.Body. Caller should > close resp.Body when done reading from it." > > It doesn't say anything about the case where err != nil > > On error, any Respon

Re: [go-nuts] Re: http response issue with leaking handles

2016-07-28 Thread Ian Davis
On Thu, Jul 28, 2016, at 03:14 PM, James Bardin wrote: > > > On Thursday, July 28, 2016 at 2:40:38 AM UTC-4, > krma...@gmail.com wrote: >> resp, err := http.Get("https://api.ipify.org?format=json";) if resp != >> nil { defer resp.Body.Close() } >> > > This is incorrect. There's no guarantee that

Re: [go-nuts] Speeding up multiple regexp matches

2016-07-28 Thread Tamás Gulácsi
You're right: the non-overlapping feature disables this approach. Then only a possible thought remains: group the regexps by their starts, like a true, and match different branches by concatenation, but differentiate with loops. I don't know whether this is feasible or sane at all, sorry. -- Yo

[go-nuts] Re: http response issue with leaking handles

2016-07-28 Thread James Bardin
On Thursday, July 28, 2016 at 2:40:38 AM UTC-4, krma...@gmail.com wrote: > > resp, err := http.Get("https://api.ipify.org?format=json";) if resp != nil > { defer resp.Body.Close() } > > This is incorrect. There's no guarantee that a non-nil Response contains a non-nil Body after an error. re

Re: [go-nuts] Speeding up multiple regexp matches

2016-07-28 Thread Val
Hello Tamás, would you provide an sample impl in playground, e.g. combining patterns "ab", "ac", "bc" into "(ab)|(ac)|(bc)" and then matching input string "zabc" ? We're expecting something like [true, false, true], or ["ab", "bc"], or equivalent. I tried but got stuck because : - returned

Re: [go-nuts] Re: first program, game of life in go

2016-07-28 Thread 'chris dollin' via golang-nuts
On 28 July 2016 at 09:04, Carl Ranson wrote: > I've seen some code that suggests that chan interface{} is a valid. > what can you send on that? Anything. The receiver has to know what to do with it, of course. Chris -- Chris "allusive" Dollin -- You received this message because you are su

[go-nuts] Re: first program, game of life in go

2016-07-28 Thread Carl Ranson
ok, fair enough. I guess I'm just used to thinking of concurrency in database terms where locking is involved. > > -- 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

[go-nuts] Re: first program, game of life in go

2016-07-28 Thread Carl Ranson
Anyone got any thoughts on the way I've used channels to synchronize things? Would I be much better off using chan bool instead of chan string for signaling? I've seen some code that suggests that chan interface{} is a valid. what can you send on that? thanks, CR -- You received this mes

Re: [go-nuts] Speeding up multiple regexp matches

2016-07-28 Thread Tamás Gulácsi
Use Submatch, concatenate the () groups, count inner opening parenthesis to map Submatch index to matching subexpression. -- 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 e

[go-nuts] [ANN] upcoming changes for cloud (not appengine) clients

2016-07-28 Thread 'Jonathan Amsterdam' via golang-nuts
If you use a package whose import path starts with "google.golang.org/cloud", please see the important announcement at google-api-go-announce . -- You received this message because you are subscribed to the Google Groups "golang-nut

Re: [go-nuts] Speeding up multiple regexp matches

2016-07-28 Thread Raj
But that won't give me list of all matched regexps. No? On Thursday, July 28, 2016 at 12:32:41 AM UTC-7, Tamás Gulácsi wrote: > > Just concatenate them with |. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and st

Re: [go-nuts] Speeding up multiple regexp matches

2016-07-28 Thread Tamás Gulácsi
Just concatenate them with |. -- 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://groups.goo

Re: [go-nuts] Who wants to use Go to process your camera's raw files?

2016-07-28 Thread Seb Binet
On Thu, Jul 28, 2016 at 5:44 AM, Jonathan Pittman < jonathan.mark.pitt...@gmail.com> wrote: > Sam, I do not think that I can use LibRAW (or LibTIFF) on appengine. And > I aim to write and run some apps on appengine that will let me do some > things with my RAW images (not just the thumbnail or th

[go-nuts] http.ListenAndServeTLS accepts .pem files

2016-07-28 Thread Tamás Gulácsi
DER is just as easily readable with openssl. Encrypting the private key may help, but would need a password, which must be provided. If you have a secure enough way to provide the password, that way could provide the unencrypted pem as well! The most secure way is limiting the let's lifetime to