Re: [go-nuts] http.Client returning "http2: no cached connection was available"

2016-08-02 Thread 'Ingo Oeser' via golang-nuts
Could you document your workaround here? 

It might be needed by others for the next 6 months because the bug has been 
classified as Go 1.8 work.

-- 
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/optout.


Re: [go-nuts] Re: IDE for GOLANG

2016-08-02 Thread Asit Dhal
If you are looking for things like auto generated files and forms with 
drag and drop(Visual Studio for ASP.Net)  or Eclipse for django. I don't 
think those are available for Revel.


I use sublime text 3 with some plugins.


On 8/3/2016 03:40, sleepy wrote:
In my idea, the best one at present is Visual Studio Code 
 + Go extension 



在 2016年8月2日星期二 UTC+8下午8:25:21,kritika...@indiamart.com写道:

Hi,
is there IDE for creating a web service in GOLANG by using Revel
framework  which follows MVC architecture.

i am using Ubuntu ..


*
*
*Watch our latest TV Commercial #IndiaKiKhoj
*

--
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/optout.


--
Warm Regards,
Asit Dhal
http://asit-dhal.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 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [go-nuts] http.Client returning "http2: no cached connection was available"

2016-08-02 Thread 'Russ Amos' via golang-nuts
Thanks for the extremely quick triage, Brad. I'll work around it in my
program, for now.

On Tue, Aug 2, 2016 at 10:08 PM Brad Fitzpatrick 
wrote:

> Oh, sorry, I read that as GODEBUG=http2debug=1.
>
> Okay, I'll follow up in https://golang.org/issues/16582
>
> On Tue, Aug 2, 2016 at 7:00 PM, Russ Amos  wrote:
>
>> Those messages aren't GODEBUG output, it's the errors printed by the
>> program as received from http.Client.Get. I'll file a bug.
>>
>> On Tue, Aug 2, 2016 at 9:51 PM Brad Fitzpatrick 
>> wrote:
>>
>>> Sorry, I don't read all of golang-nuts@ and never saw that. You
>>> could've escalated, though. There are at least two bug trackers available
>>> to you:
>>>
>>> http://b/
>>> https://github.com/golang/go/issues  (the one I prefer)
>>>
>>> But I think your interpretation of the the HTTP/2 client is wrong.
>>>
>>> If you're a video person, there's a talk on Go's HTTP client and its
>>> HTTP/2<->HTTP/1<->HTTP/2 dialing sandwich...
>>> https://www.youtube.com/watch?v=FARQMJndUn0
>>> If you're not a video person, the slides are linked from youtube.
>>>
>>> Your output in this email from your program (
>>> https://play.golang.org/p/zKthX7Y9RW) doesn't include any error output.
>>> You can ignore the GODEBUG output. If it says there's no cached connection,
>>> that means http2 has no cached connection it needs to dial (which http1
>>> will do). Then http1 works as normal, unless it decides that it negotiated
>>> http2, and then it goes back to http2.
>>>
>>> But any rate-limiting you refer to is unchanged from before, since
>>> HTTP/1 still dials as normal. There's an open bug to optimize it (to only
>>> start 1 or 2 TCP connections until we know the negotiated protocol, and
>>> then settle on 6 or 1 max connections, etc), but it's no different today
>>> than Go 1.5 and earlier.
>>>
>>> In any case, if you have a reproducible bug, let's move this to a bug
>>> tracker.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Tue, Aug 2, 2016 at 6:36 PM, 'Russ Amos' via golang-nuts <
>>> golang-nuts@googlegroups.com> wrote:
>>>
 I'm seeing "http2: no cached connection was available" failures from
 http.Client when I start many (~hundreds) requests at once. (This issue was
 also posted to golang-nuts@ in April
 ,
 with no response)

 I may not understand correctly, but I thought this kind of usage was
 fine with HTTP 1.1 and net/http, because the spec mandates a max number of
 outgoing connections to any given host, so http.Client throttles open
 connections and effectively queues requests past that. The http2 package
 seems not to do the same. That might be correct according to the spec (I
 don't know), but makes using http.Client weird -- I need to rate limit its
 usage if the server is HTTP 2, but it does rate limiting for me if the
 server is HTTP 1.1.

 Is my understanding correct? Is this a bug? Is the expectation that my
 app should be rate limiting, regardless of server version?

 Also, It seems the error being returned is exported
  in the http2
 package, but is not exported in the bundled version
  in net/http. If
 it was exported, I think I could at least retry on my own, but perhaps
 that's not the intended usage anyway.

 I wrote this program  hitting
 https://www.google.com/ to demonstrate -- here are a few run results:

 $ GODEBUG=http2client=0 go run /tmp/foo.go
 $ GODEBUG=http2client=0 go run /tmp/foo.go
 $ GODEBUG=http2client=0 go run /tmp/foo.go
 $ GODEBUG=http2client=0 go run /tmp/foo.go
 $ GODEBUG=http2client=0 go run /tmp/foo.go

 $ GODEBUG=http2client=1 go run /tmp/foo.go
 Get https://www.google.com/: http2: no cached connection was available
 Get https://www.google.com/: http2: no cached connection was available
 Get https://www.google.com/: http2: no cached connection was available
 ...
 $ GODEBUG=http2client=1 go run /tmp/foo.go
 Get https://www.google.com/: http2: no cached connection was available
 $ GODEBUG=http2client=1 go run /tmp/foo.go
 $ GODEBUG=http2client=1 go run /tmp/foo.go
 Get https://www.google.com/: http2: no cached connection was available
 Get https://www.google.com/: http2: no cached connection was available
 Get https://www.google.com/: http2: no cached connection was available
 ...
 $ GODEBUG=http2client=1 go run /tmp/foo.go
 Get https://www.google.com/: http2: no cached connection was available
 Get https://www.google.com/: http2: no cached connection was available
 Get https://www.google.com/: http2: no cached connection was available
 ...

 --
 You received this message 

Re: [go-nuts] http.Client returning "http2: no cached connection was available"

2016-08-02 Thread Brad Fitzpatrick
Oh, sorry, I read that as GODEBUG=http2debug=1.

Okay, I'll follow up in https://golang.org/issues/16582

On Tue, Aug 2, 2016 at 7:00 PM, Russ Amos  wrote:

> Those messages aren't GODEBUG output, it's the errors printed by the
> program as received from http.Client.Get. I'll file a bug.
>
> On Tue, Aug 2, 2016 at 9:51 PM Brad Fitzpatrick 
> wrote:
>
>> Sorry, I don't read all of golang-nuts@ and never saw that. You could've
>> escalated, though. There are at least two bug trackers available to you:
>>
>> http://b/
>> https://github.com/golang/go/issues  (the one I prefer)
>>
>> But I think your interpretation of the the HTTP/2 client is wrong.
>>
>> If you're a video person, there's a talk on Go's HTTP client and its
>> HTTP/2<->HTTP/1<->HTTP/2 dialing sandwich...
>> https://www.youtube.com/watch?v=FARQMJndUn0
>> If you're not a video person, the slides are linked from youtube.
>>
>> Your output in this email from your program (
>> https://play.golang.org/p/zKthX7Y9RW) doesn't include any error output.
>> You can ignore the GODEBUG output. If it says there's no cached connection,
>> that means http2 has no cached connection it needs to dial (which http1
>> will do). Then http1 works as normal, unless it decides that it negotiated
>> http2, and then it goes back to http2.
>>
>> But any rate-limiting you refer to is unchanged from before, since HTTP/1
>> still dials as normal. There's an open bug to optimize it (to only start 1
>> or 2 TCP connections until we know the negotiated protocol, and then settle
>> on 6 or 1 max connections, etc), but it's no different today than Go 1.5
>> and earlier.
>>
>> In any case, if you have a reproducible bug, let's move this to a bug
>> tracker.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Tue, Aug 2, 2016 at 6:36 PM, 'Russ Amos' via golang-nuts <
>> golang-nuts@googlegroups.com> wrote:
>>
>>> I'm seeing "http2: no cached connection was available" failures from
>>> http.Client when I start many (~hundreds) requests at once. (This issue was
>>> also posted to golang-nuts@ in April
>>> ,
>>> with no response)
>>>
>>> I may not understand correctly, but I thought this kind of usage was
>>> fine with HTTP 1.1 and net/http, because the spec mandates a max number of
>>> outgoing connections to any given host, so http.Client throttles open
>>> connections and effectively queues requests past that. The http2 package
>>> seems not to do the same. That might be correct according to the spec (I
>>> don't know), but makes using http.Client weird -- I need to rate limit its
>>> usage if the server is HTTP 2, but it does rate limiting for me if the
>>> server is HTTP 1.1.
>>>
>>> Is my understanding correct? Is this a bug? Is the expectation that my
>>> app should be rate limiting, regardless of server version?
>>>
>>> Also, It seems the error being returned is exported
>>>  in the http2
>>> package, but is not exported in the bundled version
>>>  in net/http. If it
>>> was exported, I think I could at least retry on my own, but perhaps that's
>>> not the intended usage anyway.
>>>
>>> I wrote this program  hitting
>>> https://www.google.com/ to demonstrate -- here are a few run results:
>>>
>>> $ GODEBUG=http2client=0 go run /tmp/foo.go
>>> $ GODEBUG=http2client=0 go run /tmp/foo.go
>>> $ GODEBUG=http2client=0 go run /tmp/foo.go
>>> $ GODEBUG=http2client=0 go run /tmp/foo.go
>>> $ GODEBUG=http2client=0 go run /tmp/foo.go
>>>
>>> $ GODEBUG=http2client=1 go run /tmp/foo.go
>>> Get https://www.google.com/: http2: no cached connection was available
>>> Get https://www.google.com/: http2: no cached connection was available
>>> Get https://www.google.com/: http2: no cached connection was available
>>> ...
>>> $ GODEBUG=http2client=1 go run /tmp/foo.go
>>> Get https://www.google.com/: http2: no cached connection was available
>>> $ GODEBUG=http2client=1 go run /tmp/foo.go
>>> $ GODEBUG=http2client=1 go run /tmp/foo.go
>>> Get https://www.google.com/: http2: no cached connection was available
>>> Get https://www.google.com/: http2: no cached connection was available
>>> Get https://www.google.com/: http2: no cached connection was available
>>> ...
>>> $ GODEBUG=http2client=1 go run /tmp/foo.go
>>> Get https://www.google.com/: http2: no cached connection was available
>>> Get https://www.google.com/: http2: no cached connection was available
>>> Get https://www.google.com/: http2: no cached connection was available
>>> ...
>>>
>>> --
>>> 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/optout.
>>>
>>

-- 
You 

Re: [go-nuts] http.Client returning "http2: no cached connection was available"

2016-08-02 Thread 'Russ Amos' via golang-nuts
http://golang.org/issues/16582

On Tue, Aug 2, 2016 at 10:00 PM Russ Amos  wrote:

> Those messages aren't GODEBUG output, it's the errors printed by the
> program as received from http.Client.Get. I'll file a bug.
>
> On Tue, Aug 2, 2016 at 9:51 PM Brad Fitzpatrick 
> wrote:
>
>> Sorry, I don't read all of golang-nuts@ and never saw that. You could've
>> escalated, though. There are at least two bug trackers available to you:
>>
>> http://b/
>> https://github.com/golang/go/issues  (the one I prefer)
>>
>> But I think your interpretation of the the HTTP/2 client is wrong.
>>
>> If you're a video person, there's a talk on Go's HTTP client and its
>> HTTP/2<->HTTP/1<->HTTP/2 dialing sandwich...
>> https://www.youtube.com/watch?v=FARQMJndUn0
>> If you're not a video person, the slides are linked from youtube.
>>
>> Your output in this email from your program (
>> https://play.golang.org/p/zKthX7Y9RW) doesn't include any error output.
>> You can ignore the GODEBUG output. If it says there's no cached connection,
>> that means http2 has no cached connection it needs to dial (which http1
>> will do). Then http1 works as normal, unless it decides that it negotiated
>> http2, and then it goes back to http2.
>>
>> But any rate-limiting you refer to is unchanged from before, since HTTP/1
>> still dials as normal. There's an open bug to optimize it (to only start 1
>> or 2 TCP connections until we know the negotiated protocol, and then settle
>> on 6 or 1 max connections, etc), but it's no different today than Go 1.5
>> and earlier.
>>
>> In any case, if you have a reproducible bug, let's move this to a bug
>> tracker.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> On Tue, Aug 2, 2016 at 6:36 PM, 'Russ Amos' via golang-nuts <
>> golang-nuts@googlegroups.com> wrote:
>>
>>> I'm seeing "http2: no cached connection was available" failures from
>>> http.Client when I start many (~hundreds) requests at once. (This issue was
>>> also posted to golang-nuts@ in April
>>> ,
>>> with no response)
>>>
>>> I may not understand correctly, but I thought this kind of usage was
>>> fine with HTTP 1.1 and net/http, because the spec mandates a max number of
>>> outgoing connections to any given host, so http.Client throttles open
>>> connections and effectively queues requests past that. The http2 package
>>> seems not to do the same. That might be correct according to the spec (I
>>> don't know), but makes using http.Client weird -- I need to rate limit its
>>> usage if the server is HTTP 2, but it does rate limiting for me if the
>>> server is HTTP 1.1.
>>>
>>> Is my understanding correct? Is this a bug? Is the expectation that my
>>> app should be rate limiting, regardless of server version?
>>>
>>> Also, It seems the error being returned is exported
>>>  in the http2
>>> package, but is not exported in the bundled version
>>>  in net/http. If it
>>> was exported, I think I could at least retry on my own, but perhaps that's
>>> not the intended usage anyway.
>>>
>>> I wrote this program  hitting
>>> https://www.google.com/ to demonstrate -- here are a few run results:
>>>
>>> $ GODEBUG=http2client=0 go run /tmp/foo.go
>>> $ GODEBUG=http2client=0 go run /tmp/foo.go
>>> $ GODEBUG=http2client=0 go run /tmp/foo.go
>>> $ GODEBUG=http2client=0 go run /tmp/foo.go
>>> $ GODEBUG=http2client=0 go run /tmp/foo.go
>>>
>>> $ GODEBUG=http2client=1 go run /tmp/foo.go
>>> Get https://www.google.com/: http2: no cached connection was available
>>> Get https://www.google.com/: http2: no cached connection was available
>>> Get https://www.google.com/: http2: no cached connection was available
>>> ...
>>> $ GODEBUG=http2client=1 go run /tmp/foo.go
>>> Get https://www.google.com/: http2: no cached connection was available
>>> $ GODEBUG=http2client=1 go run /tmp/foo.go
>>> $ GODEBUG=http2client=1 go run /tmp/foo.go
>>> Get https://www.google.com/: http2: no cached connection was available
>>> Get https://www.google.com/: http2: no cached connection was available
>>> Get https://www.google.com/: http2: no cached connection was available
>>> ...
>>> $ GODEBUG=http2client=1 go run /tmp/foo.go
>>> Get https://www.google.com/: http2: no cached connection was available
>>> Get https://www.google.com/: http2: no cached connection was available
>>> Get https://www.google.com/: http2: no cached connection was available
>>> ...
>>>
>>> --
>>> 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/optout.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 

Re: [go-nuts] http.Client returning "http2: no cached connection was available"

2016-08-02 Thread 'Russ Amos' via golang-nuts
Those messages aren't GODEBUG output, it's the errors printed by the
program as received from http.Client.Get. I'll file a bug.

On Tue, Aug 2, 2016 at 9:51 PM Brad Fitzpatrick  wrote:

> Sorry, I don't read all of golang-nuts@ and never saw that. You could've
> escalated, though. There are at least two bug trackers available to you:
>
> http://b/
> https://github.com/golang/go/issues  (the one I prefer)
>
> But I think your interpretation of the the HTTP/2 client is wrong.
>
> If you're a video person, there's a talk on Go's HTTP client and its
> HTTP/2<->HTTP/1<->HTTP/2 dialing sandwich...
> https://www.youtube.com/watch?v=FARQMJndUn0
> If you're not a video person, the slides are linked from youtube.
>
> Your output in this email from your program (
> https://play.golang.org/p/zKthX7Y9RW) doesn't include any error output.
> You can ignore the GODEBUG output. If it says there's no cached connection,
> that means http2 has no cached connection it needs to dial (which http1
> will do). Then http1 works as normal, unless it decides that it negotiated
> http2, and then it goes back to http2.
>
> But any rate-limiting you refer to is unchanged from before, since HTTP/1
> still dials as normal. There's an open bug to optimize it (to only start 1
> or 2 TCP connections until we know the negotiated protocol, and then settle
> on 6 or 1 max connections, etc), but it's no different today than Go 1.5
> and earlier.
>
> In any case, if you have a reproducible bug, let's move this to a bug
> tracker.
>
>
>
>
>
>
>
>
>
>
>
>
> On Tue, Aug 2, 2016 at 6:36 PM, 'Russ Amos' via golang-nuts <
> golang-nuts@googlegroups.com> wrote:
>
>> I'm seeing "http2: no cached connection was available" failures from
>> http.Client when I start many (~hundreds) requests at once. (This issue was
>> also posted to golang-nuts@ in April
>> ,
>> with no response)
>>
>> I may not understand correctly, but I thought this kind of usage was fine
>> with HTTP 1.1 and net/http, because the spec mandates a max number of
>> outgoing connections to any given host, so http.Client throttles open
>> connections and effectively queues requests past that. The http2 package
>> seems not to do the same. That might be correct according to the spec (I
>> don't know), but makes using http.Client weird -- I need to rate limit its
>> usage if the server is HTTP 2, but it does rate limiting for me if the
>> server is HTTP 1.1.
>>
>> Is my understanding correct? Is this a bug? Is the expectation that my
>> app should be rate limiting, regardless of server version?
>>
>> Also, It seems the error being returned is exported
>>  in the http2
>> package, but is not exported in the bundled version
>>  in net/http. If it
>> was exported, I think I could at least retry on my own, but perhaps that's
>> not the intended usage anyway.
>>
>> I wrote this program  hitting
>> https://www.google.com/ to demonstrate -- here are a few run results:
>>
>> $ GODEBUG=http2client=0 go run /tmp/foo.go
>> $ GODEBUG=http2client=0 go run /tmp/foo.go
>> $ GODEBUG=http2client=0 go run /tmp/foo.go
>> $ GODEBUG=http2client=0 go run /tmp/foo.go
>> $ GODEBUG=http2client=0 go run /tmp/foo.go
>>
>> $ GODEBUG=http2client=1 go run /tmp/foo.go
>> Get https://www.google.com/: http2: no cached connection was available
>> Get https://www.google.com/: http2: no cached connection was available
>> Get https://www.google.com/: http2: no cached connection was available
>> ...
>> $ GODEBUG=http2client=1 go run /tmp/foo.go
>> Get https://www.google.com/: http2: no cached connection was available
>> $ GODEBUG=http2client=1 go run /tmp/foo.go
>> $ GODEBUG=http2client=1 go run /tmp/foo.go
>> Get https://www.google.com/: http2: no cached connection was available
>> Get https://www.google.com/: http2: no cached connection was available
>> Get https://www.google.com/: http2: no cached connection was available
>> ...
>> $ GODEBUG=http2client=1 go run /tmp/foo.go
>> Get https://www.google.com/: http2: no cached connection was available
>> Get https://www.google.com/: http2: no cached connection was available
>> Get https://www.google.com/: http2: no cached connection was available
>> ...
>>
>> --
>> 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/optout.
>>
>

-- 
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/optout.


[go-nuts] Re: IDE for GOLANG

2016-08-02 Thread sleepy
In my idea, the best one at present is Visual Studio Code 
 + Go extension 


在 2016年8月2日星期二 UTC+8下午8:25:21,kritika...@indiamart.com写道:
>
> Hi, 
> is there IDE for creating a web service in GOLANG by using Revel framework 
>  which follows MVC architecture.
>
> i am using Ubuntu ..
>
>
>
> *Watch our latest TV Commercial #IndiaKiKhoj 
> *
>

-- 
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/optout.


[go-nuts] http.Client returning "http2: no cached connection was available"

2016-08-02 Thread 'Russ Amos' via golang-nuts
I'm seeing "http2: no cached connection was available" failures from
http.Client when I start many (~hundreds) requests at once. (This issue was
also posted to golang-nuts@ in April
,
with no response)

I may not understand correctly, but I thought this kind of usage was fine
with HTTP 1.1 and net/http, because the spec mandates a max number of
outgoing connections to any given host, so http.Client throttles open
connections and effectively queues requests past that. The http2 package
seems not to do the same. That might be correct according to the spec (I
don't know), but makes using http.Client weird -- I need to rate limit its
usage if the server is HTTP 2, but it does rate limiting for me if the
server is HTTP 1.1.

Is my understanding correct? Is this a bug? Is the expectation that my app
should be rate limiting, regardless of server version?

Also, It seems the error being returned is exported
 in the http2
package, but is not exported in the bundled version
 in net/http. If it was
exported, I think I could at least retry on my own, but perhaps that's not
the intended usage anyway.

I wrote this program  hitting
https://www.google.com/ to demonstrate -- here are a few run results:

$ GODEBUG=http2client=0 go run /tmp/foo.go
$ GODEBUG=http2client=0 go run /tmp/foo.go
$ GODEBUG=http2client=0 go run /tmp/foo.go
$ GODEBUG=http2client=0 go run /tmp/foo.go
$ GODEBUG=http2client=0 go run /tmp/foo.go

$ GODEBUG=http2client=1 go run /tmp/foo.go
Get https://www.google.com/: http2: no cached connection was available
Get https://www.google.com/: http2: no cached connection was available
Get https://www.google.com/: http2: no cached connection was available
...
$ GODEBUG=http2client=1 go run /tmp/foo.go
Get https://www.google.com/: http2: no cached connection was available
$ GODEBUG=http2client=1 go run /tmp/foo.go
$ GODEBUG=http2client=1 go run /tmp/foo.go
Get https://www.google.com/: http2: no cached connection was available
Get https://www.google.com/: http2: no cached connection was available
Get https://www.google.com/: http2: no cached connection was available
...
$ GODEBUG=http2client=1 go run /tmp/foo.go
Get https://www.google.com/: http2: no cached connection was available
Get https://www.google.com/: http2: no cached connection was available
Get https://www.google.com/: http2: no cached connection was available
...

-- 
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/optout.


[go-nuts] Re: IDE for GOLANG

2016-08-02 Thread Dat Huynh
I use vimgo
https://github.com/fatih/vim-go



On Tuesday, August 2, 2016 at 10:25:21 PM UTC+10, kritika...@indiamart.com 
wrote:
>
> Hi, 
> is there IDE for creating a web service in GOLANG by using Revel framework 
>  which follows MVC architecture.
>
> i am using Ubuntu ..
>
>
>
> *Watch our latest TV Commercial #IndiaKiKhoj 
> *
>

-- 
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/optout.


[go-nuts] Go 1.7 Release Candidate 5 is released

2016-08-02 Thread Chris Broadfoot
Hello gophers,

We have just released go1.7rc5, a release candidate for Go 1.7.
It is cut from release-branch.go1.7 at the revision tagged go1.7rc5.

rc5 includes three fixes: two to the `go doc` command, and one fix
for time for macOS Sierra Beta 4.

Please help us by testing your Go programs with the release, and
report any problems using the issue tracker:
  https://golang.org/issue/new

You can download binary and source distributions from the usual place: 
  https://golang.org/dl/#go1.7rc5

To find out what has changed in Go 1.7, read the draft release notes:
  https://tip.golang.org/doc/go1.7

Documentation for Go 1.7 is available at:
  https://tip.golang.org/
  
A comprehensive list of changes since rc4 is here:
  https://github.com/golang/go/compare/go1.7rc4...go1.7rc5
  
We still plan to issue Go 1.7 in a week's time (August 8).

Cheers,
Chris

-- 
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/optout.


[go-nuts] Re: Golang git library able to communicate with LFS?

2016-08-02 Thread Rick Olson
Hi Johann,

As Jakob pointed out https://github.com/github/git-lfs/lfs is the closest 
to a Go library that I know of. Unfortunately, the API is not great and 
needs to change. I wouldn't depend on it without vendoring to a specific 
commit. Our focus has been working on a stable command line tool, and not a 
set of Go packages.

Can you open a new issue on https://github.com/github/git-lfs/issues/new 
with your specific needs? We can help with package usage for now, and 
possibly prioritize what you need as an early target for refactoring.


-- 
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/optout.


Re: [go-nuts] Problem with Net UDP (ipv6) client socket

2016-08-02 Thread Jakob Borg

> On 2 aug. 2016, at 15:19, CN47  wrote:
> 
> I'm working on an API that should connect via IPv4 and Ipv6 to a server via 
> UDP packets and send/receive information to/from that server.
> 
> Please see the below example. This seems to work even though I've specified 
> "udp" and not "udp6" (Both server and client address are local to a network)
> 
> package main
> 
> import (
> "fmt"
> "net"
> )
> 
> func CheckError(err error) {
> if err  != nil {
> fmt.Println("Error: " , err)
> }
> }
> 
> func main() {
> ServerAddr,err := 
> net.ResolveUDPAddr("udp","[0:0:0:0:0::c0a8:cd36]:5400")
> CheckError(err)
> 
> LocalAddr, err := net.ResolveUDPAddr("udp", 
> "[0:0:0:0:0::c0a8:130]:5400")
> CheckError(err)
> 
> Conn, err := net.DialUDP("udp", LocalAddr, ServerAddr)
> CheckError(err)
> 
> defer Conn.Close()
> }
> 
> However, once I replace those "udp" strings with "udp6" as indicated in the 
> documentation, I get an error from the DialUDP() method "dial udp6 
> 192.168.1.48:5400->192.168.205.54:5400: bind: can't assign requested address".
> 
> For what it's worth, the code works if I replace those ipv6 strings with 
> their ipv4 strings and use "udp4" instead of "udp".
> 
> Can someone explain why udp6 doesn't seem to work?

Those are IPv4-mapped IPv6 addresses, which is to say regular IPv4 addresses 
expressed in IPv6 syntax for compatibility purposes. You are using an IPv4 
connection, which is why "udp" and "udp4" work but "udp6" doesn't. 

//jb

-- 
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/optout.


Re: [go-nuts] Re: Dynamic type cloning

2016-08-02 Thread Nathan Fisher
It sounds like you could do something similar-ish to the way sorting is
handled in the sort package with interfaces. Some immediate concerns that
jump out wrt a read and partial update that is done outside the data source:

- partial update implies some form of locking (either optimistic,
distributed, or row level).
- full update will provide a last write wins semantic, whereas a partial
update without locking could result in an undesirable when contended (can
provide an example assuming it's not something you've considers).

Also of note the example data model accommodates for empty values and not
absent values. Nothing wrong just citing it as something you may or may not
want to accommodate.


On Tue, 2 Aug 2016 at 16:58, roger peppe  wrote:

> On 2 August 2016 at 16:46, Guianu Leon  wrote:
> > Well I will only get the fields that have to be updated, not the entire
> > object. Therefore I need to get the old object from the database, see
> what
> > has changed, then insert it back.
>
> If you're seeing only the fields that have to be updated, how
> will you know that getting the object will get all the fields?
>
> For example, if I have this object in the database:
>
> {"Age": 10, "Height": 6}
>
> and I do this:
>
> type Person struct {
> Address string
> }
> db.Update("bob", {Address: "12 Some Street"})
>
> then doing a Get into a value of type *Person won't get all the fields
> that you need to update.
>
> I think you'll need a slightly cleverer implementation if you want to do
> this.
> Have you looked into the approach taken by gopkg.in/mgo.v2,
> which addresses a similar problem?
>
>   cheers,
> rog.
>
> >
> >
> > On Aug 2, 2016 18:35, "roger peppe"  wrote:
> >>
> >> On 2 August 2016 at 09:58, Rayland  wrote:
> >> > I am working in the context of an ODM.
> >> >
> >> > I have an update method, like this:
> >> >
> >> > func Update(key string, valuePtr interface{}) error
> >> >
> >> >
> >> > Inside of this method I need to do a Get in order to get the old
> value,
> >> > compare the modified fields and update them, then insert the new
> object
> >> > in
> >> > the database.
> >> >
> >> > The problem is that inside the Update method I don't know what type
> >> > valuePtr
> >> > is in order to make a second object and feed to the Get method, and
> then
> >> > if
> >> > I call the Get method with an interface{} object it will crash because
> >> > it
> >> > can't Unmarshal (objects are kept as json in the database).
> >>
> >> FWIW Axel's solution can work well and I've use similar techniques in
> >> places,
> >> but I have sympathy for Jan's reservations. Why do you need to do a Get
> >> before doing the Put - how can you tell which fields need to be updated?
> >> I can't immediately see how what you suggest would be different from
> >> just updating the database with the value directly.
> >>
> >>   cheers,
> >> rog.
> >>
> >> >
> >> > On Tuesday, August 2, 2016 at 11:26:01 AM UTC+3, Dave Cheney wrote:
> >> >>
> >> >> Hypothetically, if there was a syntax in Go that did this, what would
> >> >> you
> >> >> do next ? In other words, what is the problem you are trying to solve
> >> >> that
> >> >> has lead you to needing this feature?
> >> >>
> >> >> On Tuesday, 2 August 2016 18:18:05 UTC+10, Rayland wrote:
> >> >>>
> >> >>> I basically need something like this:
> >> >>>
> >> >>> var obj = {Name: "John"} // I don't know what type obj will
> be
> >> >>> everytime
> >> >>> var newObj interface{}
> >> >>>
> >> >>> initNewObj(obj) // now newObj is an empty object of type *Person
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>> On Tuesday, August 2, 2016 at 10:21:01 AM UTC+3, Dave Cheney wrote:
> >> 
> >>  TL;DR a shallow copy is easy, but it's almost never what you want.
> >> 
> >>  https://play.golang.org/p/wpWN3Znop8
> >> 
> >>  Needing to copy an arbitrary value is usually an anti pattern as
> >>  values
> >>  can contain references to other values, which contain references to
> >>  other
> >>  values, which contain references to other values, sometimes leading
> >>  back to
> >>  the previous values.
> >> 
> >>  On Tuesday, 2 August 2016 17:13:21 UTC+10, Rayland wrote:
> >> >
> >> > Let's say I have an object A of some type. Is there a way to
> create
> >> > a
> >> > new object B with the same type as A without knowing the type of A
> >> > in
> >> > advance?
> >> >
> >> > --
> >> > 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/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe 

Re: [go-nuts] CGO export function parameter types in packages

2016-08-02 Thread Ian Lance Taylor
On Tue, Aug 2, 2016 at 8:05 AM, Vladimír Magyar
 wrote:
>
> why is that? the MyInt type is just an alias of C.int. or?

I didn't look too closely, but I think this is https://golang.org/issue/13467 .

Ian

-- 
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/optout.


Re: [go-nuts] golang non-availability in Iran...

2016-08-02 Thread Ian Lance Taylor
On Tue, Aug 2, 2016 at 8:08 AM, Sam Whited  wrote:
> On Tue, Aug 2, 2016 at 8:43 AM, Ian Lance Taylor  wrote:
>> On Tue, Aug 2, 2016 at 1:37 AM,   wrote:
>>> Hi
>>> is golang free to all?
>>> why golang.org is block for Iranian users ??
>>
>> https://github.com/golang/go/issues/12380
>
> This feels poor to say the least; I hate to whip a dead horse, but
> would it not be possible to work around this? What if the website and
> downloads were to be hosted by a third party, non-profit in a country
> with less ridiculous export controls (with the build servers and all
> the other tooling and infrastructure still under the control of Google
> in the US)?

I am certainly not a lawyer, but I don't see a reason why Google would
be concerned if somebody else set up a mirror site of golang.org that
is accessible from all countries.

If the site you suggest is under Google's control, then Google has to
follow U.S. law.  Hosting it somewhere else is irrelevant.

Ian

-- 
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/optout.


[go-nuts] CGO export function parameter types in packages

2016-08-02 Thread Vladimír Magyar
when I create an new type from C type and then use it as a function 
parameter type, in function that I want to be exported then everything is OK

main.go:
package main

import "C"

type MyInt C.int

//export f
func f(x tests.MyInt) {
}

and then 

$ go build -v -buildmode=c-shared -o main.so main.go

but when the type is in another package, it won't compile

test.go:
package tests


import "C"


type MyInt C.int

main.go:
package main


import "C"


import "github.com/microo8/tests"


//export f
func f(x tests.MyInt) {
}

then:
$ go build -v -buildmode=c-shared -o main.so main.go   


  ~
runtime/internal/sys
runtime/internal/atomic
runtime
internal/race
sync/atomic
sync
syscall
runtime/cgo
github.com/microo8/tests
command-line-arguments
# command-line-arguments
./main.go:8:10: Go type not supported in export: tests.MyInt
./main.go:8:10: Go type not supported in export: tests.MyInt
 λ - go build -v -buildmode=c-shared -o main.so main.go 


~
runtime/internal/sys
runtime/internal/atomic
runtime
internal/race
sync/atomic
sync
syscall
runtime/cgo
github.com/microo8/tests
command-line-arguments
# command-line-arguments
./main.go:8:10: Go type not supported in export: tests.MyInt
./main.go:8:10: Go type not supported in export: tests.MyInt

why is that? the MyInt type is just an alias of C.int. or?

-- 
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/optout.


[go-nuts] Re: how to apply netutil.LimitListener() to ListenAndServeTLS()'s listener? how to fetch ListenAndServeTLS()'s listener?

2016-08-02 Thread David Marceau


Another question: Why wasn't tlsListener placed as part of the Server structure?
I think it makes sense to place it there since it is the server that creates 
and uses it.
It also makes sense to expose it to tweak it as some might more control over it 
and in this case the constraining the number of connections.
It seems we may current create as many connections as the operating system can 
handle, but isn't it more cautious to have something preventive
to limit the number of connections within the golang server itself or are you 
expecting system admins to limit the number of connections at the Operating 
System Level?

-- 
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/optout.


[go-nuts] how to apply netutil.LimitListener() to ListenAndServeTLS()'s listener? how to fetch ListenAndServeTLS()'s listener?

2016-08-02 Thread David Marceau


I found an example to limit the number of connections for a listener:
import "golang.org/x/net/netutil"//Within  net/netutil/listen.go//func 
LimitListener(l net.Listener, n int) net.Listener 
connectionCount := 2
l, err := net.Listen("tcp", ":8000")if err != nil {
log.Fatalf("Listen: %v", err)
}
defer l.Close()
l = netutil.LimitListener(l, connectionCount)
log.Fatal(http.Serve(l, nil))

BUT I'm not using net.Listen() and http.Serve().  I'm using the 
ListenAndServeTLS().

A closer look into ListenAndServeTLS:
func (srv *Server) ListenAndServeTLS(certFile, keyFile string) error
{
...
tlsListener := tls.NewListener(tcpKeepAliveListener{ln.(*net.TCPListener)}, 
config)
return srv.Serve(tlsListener)
}

How can I fetch the srv's tlsListener and then apply the 
netutil.LimitListener()?
ie.
netutil.LimitListener(srv.tlsListener, connectionCount)?

I'm doing my best not to tweak/recompile golang's sources to introduce this 
limitlistener feature to a tls server.
I was hoping someone had a trick to avoid that.

Thank you.

David Marceau


-- 
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/optout.


Re: [go-nuts] golang non-availability in Iran...

2016-08-02 Thread Sam Whited
On Tue, Aug 2, 2016 at 8:43 AM, Ian Lance Taylor  wrote:
> On Tue, Aug 2, 2016 at 1:37 AM,   wrote:
>> Hi
>> is golang free to all?
>> why golang.org is block for Iranian users ??
>
> https://github.com/golang/go/issues/12380

This feels poor to say the least; I hate to whip a dead horse, but
would it not be possible to work around this? What if the website and
downloads were to be hosted by a third party, non-profit in a country
with less ridiculous export controls (with the build servers and all
the other tooling and infrastructure still under the control of Google
in the US)?

I was under the impression that several other large companies were
doing this with their crypto, but I can't find any reference to it at
the moment and I'm sure the lawyers would fight it either way.

—Sam



-- 
Sam Whited
pub 4096R/54083AE104EA7AD3

-- 
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/optout.


Re: [go-nuts] mysql driver ?

2016-08-02 Thread Jan Mercl
On Tue, Aug 2, 2016 at 4:21 PM Victor L  wrote:

> I have to query mysql database in my code...Do i need to add github
mackage for mysql driver?
import (
_ "github.com/go-sql-driver/mysql"
)

yes

-- 

-j

-- 
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/optout.


[go-nuts] mysql driver ?

2016-08-02 Thread Victor L
I have to query mysql database in my code...Do i need to add github mackage
for mysql driver?
import (
_ "github.com/go-sql-driver/mysql"
)
Or is it already in "database/sql" and i need to register it?

Thanks,
-Victor

-- 
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/optout.


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

2016-08-02 Thread atd...@gmail.com
Having an interface between go get and the location of the repositories 
should really allow people to move packages around at will provided the 
registration of a package provides a canonical import path. (and a facility 
for the declaration of mirrors)

Now, to accomodate with vcs and demands for reproducible builds (which 
require segregation of the dependencies per project), perhaps the go tool 
could allow switching between multiple $GOPATH. (just to avoid different 
project builds conflicting at the vcs level).

Also binaries may benefit from these changes if they record the source 
release point they were compiled from.

Go gets it mostly right because the canonical package path expect backward 
compatibility. We shouldn't need SAT solvers to resolve dependencies 
normally. :)

-- 
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/optout.


Re: [go-nuts] golang non-availability in Iran...

2016-08-02 Thread Ian Lance Taylor
On Tue, Aug 2, 2016 at 1:37 AM,   wrote:
> Hi
> is golang free to all?
> why golang.org is block for Iranian users ??

https://github.com/golang/go/issues/12380

Ian

-- 
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/optout.


[go-nuts] Problem with Net UDP (ipv6) client socket

2016-08-02 Thread CN47
I'm working on an API that should connect via IPv4 and Ipv6 to a server via 
UDP packets and send/receive information to/from that server.

Please see the below example. This seems to work even though I've specified 
"udp" and not "udp6" (Both server and client address are local to a network)

package main

import (
"fmt"
"net"
)

func CheckError(err error) {
if err  != nil {
fmt.Println("Error: " , err)
}
}

func main() {
ServerAddr,err := 
net.ResolveUDPAddr("udp","[0:0:0:0:0::c0a8:cd36]:5400")
CheckError(err)

LocalAddr, err := net.ResolveUDPAddr("udp", 
"[0:0:0:0:0::c0a8:130]:5400")
CheckError(err)

Conn, err := net.DialUDP("udp", LocalAddr, ServerAddr)
CheckError(err)

defer Conn.Close()
}

However, once I replace those "udp" strings with "udp6" as indicated in the 
documentation, I get an error from the DialUDP() method "dial udp6 
192.168.1.48:5400->192.168.205.54:5400: bind: can't assign requested 
address".

For what it's worth, the code works if I replace those ipv6 strings with 
their ipv4 strings and use "udp4" instead of "udp".

Can someone explain why udp6 doesn't seem to work?

-- 
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/optout.


[go-nuts] mgo r2016.08.01 released

2016-08-02 Thread Gustavo Niemeyer
Hello Gophers,

A major new release of mgo was just published with relevant enhancements
and fixes:

http://blog.labix.org/2016/08/01/mgo-r2016-08-01

Please let me know if you find any issues.


gustavo @ http://niemeyer.net

-- 
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/optout.


Re: [go-nuts] Where can I read the slide of "The Design of the Go Assembler" on GopherCon2016 ?

2016-08-02 Thread Rob Pike
They will be posted when the video is available.

-rob


On Tue, Aug 2, 2016 at 10:32 PM, Cholerae Hu  wrote:

> Hi golang-nuts,
> Recently I'm reading slides of GopherCon2016, but I can't found the slide
> of "The Design of the Go Assembler". The official repo on github (
> https://github.com/gophercon/2016-talks/blob/master/RobPike-TheDesignOfTheGoAssembler/README.md)
> gives me an url(https://talks.golang.org/2016/asm.slide) which is
> invalid. So where can I read this slide ?
>
> --
> 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/optout.
>

-- 
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/optout.


[go-nuts] iterating in golang

2016-08-02 Thread kritika . mittal
i want to iterate through the results fetched by executing the query .

i have the following code snippet :-

  iter := session.Query("select * from test_table where  ID= ? ", g).Iter() 

now i want to iterate through the iterator such that if the table structure 
of test_table is like 

column_1 || column_2 || column_3 || column_4 ||
   a||   b||   c ||  d  ||


i want to store the results in map such that key s the column name and 
value is the c=column vale


please help by including the import statements as well 

-- 

*Watch our latest TV Commercial #IndiaKiKhoj 
*

-- 
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/optout.


[go-nuts] importing the structure and methods from other folders

2016-08-02 Thread kritika . mittal

>
>  hi,
> i am tryin to implement MVC architecture in GOLANG. 
> i am using revel framework .
>
> i have created two folders model and controller . 
> now according to MVS ,logic should be in controller and when i am trying 
> to access the funtion written in model folder in controller , i am getting 
> error .
>
> please help me with import statements that i should include with example 
> if possible 
>

-- 

*Watch our latest TV Commercial #IndiaKiKhoj 
*

-- 
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/optout.


[go-nuts] IDE for GOLANG

2016-08-02 Thread kritika . mittal
Hi, 
is there IDE for creating a web service in GOLANG by using Revel framework 
 which follows MVC architecture.

i am using Ubuntu ..


-- 

*Watch our latest TV Commercial #IndiaKiKhoj 
*

-- 
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/optout.


[go-nuts] gomobile - go version required and how to report bugs/questions

2016-08-02 Thread danilolr
Hi,

  I am making some basic tests with gomobile.
  It is not working.

  What are the requirements of go version ? I am using go 1.6 on linux.

  What are the right place to post issues / bug reports ? There are no 
issues tab on https://github.com/golang/mobile. 
  What is the right place to place questions about the use/developement 
questions about gomobile. 

  Thanks.

Danilo.

-- 
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/optout.


[go-nuts] golang non-availability in Iran...

2016-08-02 Thread vejdani . shojae
Hi
is golang free to all?
why golang.org is block for Iranian users ??

-- 
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/optout.


[go-nuts] Re: memory allocations in net-related modules

2016-08-02 Thread postmaster

sync.Pool can suppress many of this allocations. 

-- 
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/optout.


[go-nuts] Re: gomobile installation problem

2016-08-02 Thread vejdani . shojae


> Something is interfering with your computer accessing that URL. Probably a 
> proxy, anti virus, or wifi captive portal.


I live in Iran and golang.org is blocked for Iranian users by golang 
company ... it is our right than can be use freely golang ... that's true? 

-- 
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/optout.


Re: [go-nuts] Golang git library able to communicate with LFS?

2016-08-02 Thread Johann Höchtl
Am Dienstag, 2. August 2016 11:59:26 UTC+2 schrieb Jakob Borg:
>
> The repo you linked to includes the official client code. That's 
> probably the best starting point. 
>
> Which repo do you mean? https://github.com/git-lfs/lfs-test-server is a 
server library exposing LFS API endpoint, it's not a client library? 

2016-08-02 11:42 GMT+02:00 Johann Höchtl : 
>
> > Hi, 
> > 
> > Is there a golang library available which is able to access Git LFS 
> > https://github.com/git-lfs/lfs-test-server ? 
> > 
> > https://github.com/libgit2/git2go ? 
> > https://github.com/src-d/go-git ? 
> > 
> > Thank you, Johann 
> > 
> > -- 
> > 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...@googlegroups.com . 
> > For more options, visit https://groups.google.com/d/optout. 
>

-- 
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/optout.


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

2016-08-02 Thread atd...@gmail.com
Indeed, that's where we are coming short. The Go ecosystem does not own its 
package releasing process. (with a release identification scheme that may 
different from semver since we do not need to worry about major versions 
for reasons of different release semantics)

A `go release` command that would prepare a package for release could be 
the addition required. 

It will most likely  require to have a centralization of these package 
releases. Declined under a solution that can be internal for companies that 
need a tighter control over their dependencies OR fully web facing for 
gophers in the large).

I say package releases, but the repository can be anywhere people want, I 
don't think Google has to deal with the hosting of repos.

On Tuesday, August 2, 2016 at 10:20:59 AM UTC+2, Dave Cheney wrote:
>
> That's somewhat the intent in enabling the timestamping of packages 
>> especially wrt. library-vendored package.
>> Flattening dependencies will still be needed but it would be simply a 
>> matter of switching a package to the latest package release that a package 
>> may have vendored.
>>
>>
> To do this you need to have some _machine consumable_ notion of what is 
> the "latest release" of a package. This currently doesn't exist for Go 
> projects. 
>

-- 
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/optout.


[go-nuts] Re: memory allocations in net-related modules

2016-08-02 Thread Dave Cheney
You cannot, the address of sa escapes to the heap because it is returned to 
the caller. The solution may be to refactor the method to take a 
*syscall.SockaddrInet4 that was allocated in the caller, but that is not 
something that can be done as a consumer of the net package.

On Tuesday, 2 August 2016 18:21:35 UTC+10, Михаил Монашёв wrote:
>
> Hi, golang-nuts. 
>
> I'm  trying  to  speed up my app, and deleted all of memory allocation 
> from my code. But how to prevent memory allocation here? 
>
>
> ROUTINE  net.ipToSockaddr in 
> C:/Go/src/net/ipsock_posix.go 
> 516093 516093 (flat, cum) 24.33% of Total 
>  .  .166:   } 
>  .  .167:   ip4 := ip.To4() 
>  .  .168:   if ip4 == nil { 
>  .  .169:   return nil, 
> {Err: "non-IPv4 address", Addr: ip.String()} 
>  .  .170:   } 
> 516093 516093171:   sa := {Port: 
> port} 
>  .  .172:   copy(sa.Addr[:], ip4) 
>  .  .173:   return sa, nil 
>  .  .174:   case syscall.AF_INET6: 
>  .  .175:   // In general, an IP wildcard 
> address, which is either 
>  .  .176:   // "0.0.0.0" or "::", means the 
> entire IP addressing 
> ROUTINE  syscall.(*RawSockaddrAny).Sockaddr in 
> C:/Go/src/syscall/syscall_windows.go 
> 516158 516158 (flat, cum) 24.33% of Total 
>  .  .678:   case AF_UNIX: 
>  .  .679:   return nil, EWINDOWS 
>  .  .680: 
>  .  .681:   case AF_INET: 
>  .  .682:   pp := 
> (*RawSockaddrInet4)(unsafe.Pointer(rsa)) 
> 516158 516158683:   sa := new(SockaddrInet4) 
>  .  .684:   p := 
> (*[2]byte)(unsafe.Pointer()) 
>  .  .685:   sa.Port = int(p[0])<<8 + int(p[1]) 
>  .  .686:   for i := 0; i < len(sa.Addr); i++ 
> { 
>  .  .687:   sa.Addr[i] = pp.Addr[i] 
>  .  .688:   } 
> ROUTINE  net.(*UDPConn).readFrom in 
> C:/Go/src/net/udpsock_posix.go 
> 5160281168218 (flat, cum) 55.07% of Total 
>  .  . 38:   return ipToSockaddr(family, a.IP, a.Port, 
> a.Zone) 
>  .  . 39:} 
>  .  . 40: 
>  .  . 41:func (c *UDPConn) readFrom(b []byte) (int, 
> *UDPAddr, error) { 
>  .  . 42:   var addr *UDPAddr 
>  . 652190 43:   n, sa, err := c.fd.readFrom(b) 
>  .  . 44:   switch sa := sa.(type) { 
>  .  . 45:   case *syscall.SockaddrInet4: 
> 516028 516028 46:   addr = {IP: sa.Addr[0:], 
> Port: sa.Port} 
>  .  . 47:   case *syscall.SockaddrInet6: 
>  .  . 48:   addr = {IP: sa.Addr[0:], 
> Port: sa.Port, Zone: zoneToString(int(sa.ZoneId))} 
>  .  . 49:   } 
>  .  . 50:   return n, addr, err 
>  .  . 51:} 
> Total: 2121170 
> ROUTINE  syscall.WSARecv in 
> C:/Go/src/syscall/zsyscall_windows.go 
> 122693 122695 (flat, cum)  5.78% of Total 
>  .  .   1515:   Syscall9(procGetAcceptExSockaddrs.Addr(), 
> 8, uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), 
>  uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(lrsa)), 
> uintptr(unsafe.Pointer(lrsalen)), uintptr(unsafe.Pointer 
> (rrsa)), uintptr(unsafe.Pointer(rrsalen)), 0) 
>  .  .   1516:   return 
>  .  .   1517:} 
>  .  .   1518: 
>  .  .   1519:func WSARecv(s Handle, bufs *WSABuf, bufcnt 
> uint32, recvd *uint32, flags *uint32, overlapped *Ove 
> rlapped, croutine *byte) (err error) { 
>  .  2   1520:   r1, _, e1 := Syscall9(procWSARecv.Addr(), 
> 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintpt 
> r(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), 
> uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe 
> .Pointer(croutine)), 0, 0) 
>  .  .   1521:   if r1 == socket_error { 
>  .  .   1522:   if e1 != 0 { 
> 122693 122693   1523:   err = error(e1) 
>  .  .   1524:   } else { 
>  .  .   1525:   err = EINVAL 
>  .  .   1526:   } 
>  .  .   1527:   } 
>  .  .   1528:   return 
> ROUTINE  syscall.WSARecvFrom in 
> C:/Go/src/syscall/zsyscall_windows.go 
> 135757 135757 (flat, cum)  6.40% of Total 
>  .  

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

2016-08-02 Thread atd...@gmail.com
That's somewhat the intent in enabling the timestamping of packages 
especially wrt. library-vendored package.
Flattening dependencies will still be needed but it would be simply a 
matter of switching a package to the latest package release that a package 
may have vendored.

But again, I would not build a solution by strictly imitating vcs or other 
package managers from a methodology point of view. They do not handle 
packages the same so the solution has to be different.

I firmly believe that the current assumptions held by Go tooling can help 
us find a quite simple(r) solution (than already exists for other 
languages).

On Tuesday, August 2, 2016 at 6:17:35 AM UTC+2, Lucio wrote:
>
>
>
> On Saturday, 30 July 2016 02:52:25 UTC+2, Matt Harden wrote:
>>
>> I like submodules, but they do only work when you're using git and only 
>> vendoring projects that also use git.
>>
>>
>>>
>>> It seems to me that the solution is staring us in the face. I know 
> nothing about git submodules, but they have been raised in this forum 
> before and the only criticism has been that no other VCS has them. If they 
> accomplish what Go developers need, then Go must model any solution on them.
>
> It surely does not make sense to overlook them because no other VCS has 
> them: in favour of what? No other VCS has anything better or even as good. 
> So, within reasonable limits, (a) Go needs to adopt Git submodules and (b) 
> Go must provide analogous tooling for alternative VCSs.
>
> Inventing something totally orthogonal to serve the same purpose would be 
> unreasonable.
>
> I appreciate that Git submodules are not the final answer, but I do 
> presume that they ought to be the foundations for any discussion.
>
> Lucio.
>

-- 
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/optout.


[go-nuts] Re: Dynamic type cloning

2016-08-02 Thread Dave Cheney
TL;DR a shallow copy is easy, but it's almost never what you want.

https://play.golang.org/p/wpWN3Znop8

Needing to copy an arbitrary value is usually an anti pattern as values can 
contain references to other values, which contain references to other 
values, which contain references to other values, sometimes leading back to 
the previous values.

On Tuesday, 2 August 2016 17:13:21 UTC+10, Rayland wrote:
>
> Let's say I have an object A of some type. Is there a way to create a new 
> object B with the same type as A without knowing the type of A in advance?
>

-- 
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/optout.