Re: [go-nuts] runtime: panic in net/http.(*Server).Serve

2019-11-25 Thread Robert Engels
It looks like the race detector outputs when it detects a race, not at program 
end, so it doesn’t apply in your case. 

So, I would look into cgo and other unsafe usages. 

> On Nov 26, 2019, at 12:18 AM, 黃翔蔚  wrote:
> 
> Hi Robert,
> I don't understand what you mean. Could you please explain more detail?
> Thanks.
> 
> Walter
> 
> Robert Engels於 2019年11月26日星期二 UTC+8上午9時16分42秒寫道:
>> 
>> I think with -race you want to exit before it crashes. After running a 
>> while. Can’t remember though. Check the docs. 
>> 
>>> On Nov 25, 2019, at 7:10 PM, 黃翔蔚  wrote:
>>> 
>>> 
>>> Hi lan,
>>> Thanks for your reply.
>>> I built the program with -race option. There is no news in crash dump.
>>> I will review cgo portion again. Thanks again.
>>> 
>>> Walter
>>> 
>>> Ian Lance Taylor於 2019年11月26日星期二 UTC+8上午3時12分06秒寫道:
 
 On Mon, Nov 25, 2019 at 9:23 AM 黃翔蔚  wrote: 
 > 
 > My program will get panic issue from time to time. 
 > I don't have procedure to reproduce this issue. 
 > So far, the issue is happen on 10/23, 10/25, 10/30, 11/14 and 11/22. 
 > In the last try, I capture packets by wireshark, it seems no packet 
 > incoming when panic. 
 > I also try go build -race. There is no useful clues in crash dump. 
 > Any suggestion is welcome. 
 
 The most common cause for this kind of problem is memory corruption. 
 Run your program under the race detector.  Look closely at any uses of 
 unsafe or cgo. 
 
 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 golan...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/golang-nuts/c68e43ec-11a5-4d0c-9eac-b31d8fb91d7a%40googlegroups.com.
> 
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/a25c9e13-e92c-4802-9ea9-15d3c7aeeba0%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/7458BEE7-3CFB-4122-B88D-CD5FBB4C0A9B%40ix.netcom.com.


Re: [go-nuts] runtime: panic in net/http.(*Server).Serve

2019-11-25 Thread 黃翔蔚
Hi Robert,
I don't understand what you mean. Could you please explain more detail?
Thanks.

Walter

Robert Engels於 2019年11月26日星期二 UTC+8上午9時16分42秒寫道:
>
> I think with -race you want to exit before it crashes. After running a 
> while. Can’t remember though. Check the docs. 
>
> On Nov 25, 2019, at 7:10 PM, 黃翔蔚 > 
> wrote:
>
> 
> Hi lan,
> Thanks for your reply.
> I built the program with -race option. There is no news in crash dump.
> I will review cgo portion again. Thanks again.
>
> Walter
>
> Ian Lance Taylor於 2019年11月26日星期二 UTC+8上午3時12分06秒寫道:
>>
>> On Mon, Nov 25, 2019 at 9:23 AM 黃翔蔚  wrote: 
>> > 
>> > My program will get panic issue from time to time. 
>> > I don't have procedure to reproduce this issue. 
>> > So far, the issue is happen on 10/23, 10/25, 10/30, 11/14 and 11/22. 
>> > In the last try, I capture packets by wireshark, it seems no packet 
>> incoming when panic. 
>> > I also try go build -race. There is no useful clues in crash dump. 
>> > Any suggestion is welcome. 
>>
>> The most common cause for this kind of problem is memory corruption. 
>> Run your program under the race detector.  Look closely at any uses of 
>> unsafe or cgo. 
>>
>> 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 golan...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/c68e43ec-11a5-4d0c-9eac-b31d8fb91d7a%40googlegroups.com
>  
> 
> .
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/a25c9e13-e92c-4802-9ea9-15d3c7aeeba0%40googlegroups.com.


Re: [go-nuts] [ANN] Golang Oriented to Aspects (goa) v0.0.1 is released!!!

2019-11-25 Thread Iván Corrales Solera
Thanks for feedback! Totally agree I should publish documentation about how 
goa works. I will publish asap.

On Tuesday, November 26, 2019 at 12:26:40 AM UTC+1, Robert Engels wrote:
>
> I think a “how it works” and “usages” in the documentation would be 
> helpful. Great work. 
>
> On Nov 25, 2019, at 5:19 PM, Dimas Prawira  > wrote:
>
> 
> Nice... #clap
>
> BR
>
>
> On Tue, Nov 26, 2019, 4:47 AM Iván Corrales Solera  > wrote:
>
>> Hey folks!
>>
>> I am so happy yo announce the first release of *Goa*. Goa is a library 
>> that will drive you to the AOP (Aspect Oriented Paradigm) world!
>>
>> Even though I still have to work hard on this library, I would appreciate 
>> some feedback for you guys!.
>>
>> The full documentation can be found here 
>>
>>- Source ode https://github.com/wesovilabs/goa
>>- Full documentation http://wesovilabs.github.io/goa  
>>
>>
>>
>> Thank you so much for your time! and I hope you enjoy it!
>>
>> -- 
>> 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 golan...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/7b0347e8-e7c1-4dab-afcb-9608573d7d2b%40googlegroups.com
>>  
>> 
>> .
>>
> -- 
> 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 golan...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUeMP54Lv636hNE5i4_M4u1JCEsJaW-NFnf%3DgjMGiwGvTw%40mail.gmail.com
>  
> 
> .
>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/088e7761-347d-4769-a57c-2c5e00ebedee%40googlegroups.com.


Re: [go-nuts] runtime: panic in net/http.(*Server).Serve

2019-11-25 Thread Robert Engels
I think with -race you want to exit before it crashes. After running a while. 
Can’t remember though. Check the docs. 

> On Nov 25, 2019, at 7:10 PM, 黃翔蔚  wrote:
> 
> 
> Hi lan,
> Thanks for your reply.
> I built the program with -race option. There is no news in crash dump.
> I will review cgo portion again. Thanks again.
> 
> Walter
> 
> Ian Lance Taylor於 2019年11月26日星期二 UTC+8上午3時12分06秒寫道:
>> 
>> On Mon, Nov 25, 2019 at 9:23 AM 黃翔蔚  wrote: 
>> > 
>> > My program will get panic issue from time to time. 
>> > I don't have procedure to reproduce this issue. 
>> > So far, the issue is happen on 10/23, 10/25, 10/30, 11/14 and 11/22. 
>> > In the last try, I capture packets by wireshark, it seems no packet 
>> > incoming when panic. 
>> > I also try go build -race. There is no useful clues in crash dump. 
>> > Any suggestion is welcome. 
>> 
>> The most common cause for this kind of problem is memory corruption. 
>> Run your program under the race detector.  Look closely at any uses of 
>> unsafe or cgo. 
>> 
>> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/c68e43ec-11a5-4d0c-9eac-b31d8fb91d7a%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/09DDD2E0-EC66-4EFA-B5F9-F5D83C15D720%40ix.netcom.com.


Re: [go-nuts] runtime: panic in net/http.(*Server).Serve

2019-11-25 Thread 黃翔蔚
Hi lan,
Thanks for your reply.
I built the program with -race option. There is no news in crash dump.
I will review cgo portion again. Thanks again.

Walter

Ian Lance Taylor於 2019年11月26日星期二 UTC+8上午3時12分06秒寫道:
>
> On Mon, Nov 25, 2019 at 9:23 AM 黃翔蔚 > 
> wrote: 
> > 
> > My program will get panic issue from time to time. 
> > I don't have procedure to reproduce this issue. 
> > So far, the issue is happen on 10/23, 10/25, 10/30, 11/14 and 11/22. 
> > In the last try, I capture packets by wireshark, it seems no packet 
> incoming when panic. 
> > I also try go build -race. There is no useful clues in crash dump. 
> > Any suggestion is welcome. 
>
> The most common cause for this kind of problem is memory corruption. 
> Run your program under the race detector.  Look closely at any uses of 
> unsafe or cgo. 
>
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/c68e43ec-11a5-4d0c-9eac-b31d8fb91d7a%40googlegroups.com.


[go-nuts] Re: ? How restrict usage of packages ?

2019-11-25 Thread Scott Pakin
On Monday, November 25, 2019 at 9:55:55 AM UTC-7, Daniel Norte Moraes wrote:
>
>I Want create and permite my users to create go lang programs mostly 
> with full capabilities from
> golang itself, but with some direct capabilities as net and filesystem 
> striped from direct accesss; mostly 
> capabilities as database access, and network access will be encapsuled in 
> ours third parthy golang libs :-)
>   The intent is use golang as a full-fledge compiled language and as 
> substitute for a need a custom scripted language.
>

I do something much like that for my Go Server Pages 
 project, which lets one embed Go code in a Web 
page à la PHP.  The Web server administrator can choose which packages are 
allowed to be imported, with the default being only the provided gosp 
package , which 
encapsulates a few functions from some of the standard packages.  Check out 
the gosp2go source directory 
 and in particular 
the ValidateImports method in utils.go 

.

— Scott

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/d6b3f18b-7abf-4a4f-94fc-02475bd43088%40googlegroups.com.


Re: [go-nuts] [ANN] Golang Oriented to Aspects (goa) v0.0.1 is released!!!

2019-11-25 Thread Robert Engels
I think a “how it works” and “usages” in the documentation would be helpful. 
Great work. 

> On Nov 25, 2019, at 5:19 PM, Dimas Prawira  
> wrote:
> 
> 
> Nice... #clap
> 
> BR
> 
> 
>> On Tue, Nov 26, 2019, 4:47 AM Iván Corrales Solera 
>>  wrote:
>> Hey folks!
>> 
>> I am so happy yo announce the first release of Goa. Goa is a library that 
>> will drive you to the AOP (Aspect Oriented Paradigm) world!
>> 
>> Even though I still have to work hard on this library, I would appreciate 
>> some feedback for you guys!.
>> 
>> The full documentation can be found here 
>> Source ode https://github.com/wesovilabs/goa
>> Full documentation http://wesovilabs.github.io/goa 
>> 
>> Thank you so much for your time! and I hope you enjoy it!
>> -- 
>> 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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/7b0347e8-e7c1-4dab-afcb-9608573d7d2b%40googlegroups.com.
> 
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUeMP54Lv636hNE5i4_M4u1JCEsJaW-NFnf%3DgjMGiwGvTw%40mail.gmail.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/39F094A1-20ED-4611-A157-47103FD48090%40ix.netcom.com.


Re: [go-nuts] [ANN] Golang Oriented to Aspects (goa) v0.0.1 is released!!!

2019-11-25 Thread Dimas Prawira
Nice... #clap

BR


On Tue, Nov 26, 2019, 4:47 AM Iván Corrales Solera <
ivan.corrales.sol...@gmail.com> wrote:

> Hey folks!
>
> I am so happy yo announce the first release of *Goa*. Goa is a library
> that will drive you to the AOP (Aspect Oriented Paradigm) world!
>
> Even though I still have to work hard on this library, I would appreciate
> some feedback for you guys!.
>
> The full documentation can be found here
>
>- Source ode https://github.com/wesovilabs/goa
>- Full documentation http://wesovilabs.github.io/goa
>
>
>
> Thank you so much for your time! and I hope you enjoy it!
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/7b0347e8-e7c1-4dab-afcb-9608573d7d2b%40googlegroups.com
> 
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bp%2BMUeMP54Lv636hNE5i4_M4u1JCEsJaW-NFnf%3DgjMGiwGvTw%40mail.gmail.com.


[go-nuts] [ANN] Golang Oriented to Aspects (goa) v0.0.1 is released!!!

2019-11-25 Thread Iván Corrales Solera
Hey folks!

I am so happy yo announce the first release of *Goa*. Goa is a library that 
will drive you to the AOP (Aspect Oriented Paradigm) world!

Even though I still have to work hard on this library, I would appreciate 
some feedback for you guys!.

The full documentation can be found here 

   - Source ode https://github.com/wesovilabs/goa
   - Full documentation http://wesovilabs.github.io/goa  
   


Thank you so much for your time! and I hope you enjoy it!

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/7b0347e8-e7c1-4dab-afcb-9608573d7d2b%40googlegroups.com.


Re: [go-nuts] early close of http.Client's Response.Body

2019-11-25 Thread Andy Balholm
Read-to-EOF is one of several conditions for connection reuse:

- Was the response body fully read (to EOF)?
- Does the server support HTTP keep-alives?
- Is DisableKeepAlives set to false (the default) on the http.Transport that 
the client uses?

A connection will only be reused if all of these are met. Otherwise Close will 
close the connection.

There is no need to discard a Client after an early Close. A Client is not tied 
to a single connection.

Andy

> On Nov 25, 2019, at 11:10 AM, Liam Breck  wrote:
> 
> 
> 
> On Mon, Nov 25, 2019, 10:32 AM Andy Balholm  > wrote:
> 
> 
> > On Nov 25, 2019, at 9:54 AM, Liam  > > wrote:
> > 
> > - does the read-to-EOF stipulation also apply to Client.Get/Post() ?
> 
> Yes. Those methods are fairly simple wrappers around Do.
> 
> > - why does Response.Body.Close() before io.EOF not release unread buffers 
> > or otherwise prepare it for persistence?
> 
> The connection can’t be reused for another request before all the data from 
> the first request is read. The server is sending those bytes over the wire, 
> and they need to go somewhere before another response can be read. So there 
> were two options for how to implement Close when the whole body hasn’t been 
> read:
> 
> 1. Copy the rest of the body to /dev/null (or equivalent), and reuse the 
> connection like normal.
> 2. Close the connection, thus communicating to the server that we don’t need 
> that data after all.
> 
> Option 1 would generally be preferable for short responses, and option 2 for 
> long ones. For consistency, and because we don’t always know the response 
> length in advance (e.g. if it is chunked), it always does option 2.
> 
> So after read-to-EOF, Close() behaves differently, i.e. it does reset for 
> next request?
> 
> In the event of early Close(), should I discard that Client instance? Or will 
> it work for subsequent requests?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/5DB3F0EE-D976-412C-860F-C4468AF99B1F%40gmail.com.


Re: [go-nuts] runtime: panic in net/http.(*Server).Serve

2019-11-25 Thread Ian Lance Taylor
On Mon, Nov 25, 2019 at 9:23 AM 黃翔蔚  wrote:
>
> My program will get panic issue from time to time.
> I don't have procedure to reproduce this issue.
> So far, the issue is happen on 10/23, 10/25, 10/30, 11/14 and 11/22.
> In the last try, I capture packets by wireshark, it seems no packet incoming 
> when panic.
> I also try go build -race. There is no useful clues in crash dump.
> Any suggestion is welcome.

The most common cause for this kind of problem is memory corruption.
Run your program under the race detector.  Look closely at any uses of
unsafe or cgo.

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVpuqEYkV81ETAuvbEbsJNzj3LqznYP6jNe0DA51HyybQ%40mail.gmail.com.


Re: [go-nuts] early close of http.Client's Response.Body

2019-11-25 Thread Liam Breck
On Mon, Nov 25, 2019, 10:32 AM Andy Balholm  wrote:

>
>
> > On Nov 25, 2019, at 9:54 AM, Liam  wrote:
> >
> > - does the read-to-EOF stipulation also apply to Client.Get/Post() ?
>
> Yes. Those methods are fairly simple wrappers around Do.
>
> > - why does Response.Body.Close() before io.EOF not release unread
> buffers or otherwise prepare it for persistence?
>
> The connection can’t be reused for another request before all the data
> from the first request is read. The server is sending those bytes over the
> wire, and they need to go somewhere before another response can be read. So
> there were two options for how to implement Close when the whole body
> hasn’t been read:
>
> 1. Copy the rest of the body to /dev/null (or equivalent), and reuse the
> connection like normal.
> 2. Close the connection, thus communicating to the server that we don’t
> need that data after all.
>
> Option 1 would generally be preferable for short responses, and option 2
> for long ones. For consistency, and because we don’t always know the
> response length in advance (e.g. if it is chunked), it always does option 2.
>

So after read-to-EOF, Close() behaves differently, i.e. it does reset for
next request?

In the event of early Close(), should I discard that Client instance? Or
will it work for subsequent requests?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAKvHMgRH6K5WBdAoMVnq6KsHi7Hnqqhm39ZcUHX%3DWBCbfKsiwg%40mail.gmail.com.


[go-nuts] Re: 1.13.4: go mod: weird permissions in pkg/mod after go get

2019-11-25 Thread 'Bryan Mills' via golang-nuts
The go/loader issue looks like https://golang.org/issue/34860 combined with 
some other bug in one of the go/loader error-handling paths.
(Note that in general we recommend golang.org/x/tools/go/packages 
 for Go tools that 
support module mode.)

What is the underlying problem you were trying to solve when you ran into 
trouble with permissions?


On Saturday, November 23, 2019 at 4:40:20 AM UTC-5, clement auger wrote:
>
> in regard of Sean comment and FTR, 
>
> Now using version go1.13.4
> [clementauger@Host-001 ~] $ ll gow/
> bin/ pkg/ src/ 
> [clementauger@Host-001 ~] $ ll gow/
> bin/ pkg/ src/ 
> [clementauger@Host-001 ~] $ ll gow/pkg/mod/
> cache/  github.com/ golang.org/ gopkg.in/   
> [clementauger@Host-001 ~] $ ll gow/pkg/mod/github.com/apex/
> total 4
> dr-xr-xr-x 5 clementauger clementauger 4096 15 oct.  21:00 log@v1.1.1
> [clementauger@Host-001 ~] $ ll gow/pkg/mod/github.com/apex/*/*
> -r--r--r--  1 clementauger clementauger  794 15 oct.  21:00 gow/pkg/mod/
> github.com/apex/log@v1.1.1/default.go
> -r--r--r--  1 clementauger clementauger  430 15 oct.  21:00 gow/pkg/mod/
> github.com/apex/log@v1.1.1/doc.go
>
> $ ll gow/pkg/mod/github.com/hashicorp/
> total 8
> dr-x-- 2 clementauger clementauger 4096 22 nov.  20:35 errwrap@v1.0.0
> dr-x-- 2 clementauger clementauger 4096 22 nov.  20:35 
> go-multierror@v1.0.0
>
> $ ll gow/pkg/mod/github.com/hashicorp/*/*
> -r--r--r-- 1 clementauger clementauger  4377 22 nov.  20:35 gow/pkg/mod/
> github.com/hashicorp/errwrap@v1.0.0/errwrap.go
> -r--r--r-- 1 clementauger clementauger  1292 22 nov.  20:35 gow/pkg/mod/
> github.com/hashicorp/errwrap@v1.0.0/errwrap_test.go
> -r--r--r-- 1 clementauger clementauger36 22 nov.  20:35 gow/pkg/mod/
> github.com/hashicorp/errwrap@v1.0.0/go.mod
> -r--r--r-- 1 clementauger clementauger 15977 22 nov.  20:35 gow/pkg/mod/
> github.com/hashicorp/errwrap@v1.0.0/LICENSE
>
>
>
>
> Le vendredi 22 novembre 2019 20:40:56 UTC+1, clement auger a écrit :
>>
>> hi,
>>
>> I have some weird permissions set on my module files after i run go get 
>> on my project.
>>
>> please check my session
>>
>> [clementauger@Host-001 jenjen-stream] $ go version
>> go version go1.13.4 linux/amd64
>> [clementauger@Host-001 jenjen-stream] $ go env
>> GO111MODULE=""
>> GOARCH="amd64"
>> GOBIN=""
>> GOCACHE="/home/clementauger/.cache/go-build"
>> GOENV="/home/clementauger/.config/go/env"
>> GOEXE=""
>> GOFLAGS=""
>> GOHOSTARCH="amd64"
>> GOHOSTOS="linux"
>> GONOPROXY=""
>> GONOSUMDB=""
>> GOOS="linux"
>> GOPATH="/home/clementauger/gow"
>> GOPRIVATE=""
>> GOPROXY="https://proxy.golang.org,direct;
>> GOROOT="/home/clementauger/.gvm/gos/go1.13.4"
>> GOSUMDB="sum.golang.org"
>> GOTMPDIR=""
>> GOTOOLDIR="/home/clementauger/.gvm/gos/go1.13.4/pkg/tool/linux_amd64"
>> GCCGO="gccgo"
>> AR="ar"
>> CC="gcc"
>> CXX="g++"
>> CGO_ENABLED="1"
>> GOMOD="/home/clementauger/gow/src/
>> github.com/clementauger/jenjen-stream/go.mod"
>> CGO_CFLAGS="-g -O2"
>> CGO_CPPFLAGS=""
>> CGO_CXXFLAGS="-g -O2"
>> CGO_FFLAGS="-g -O2"
>> CGO_LDFLAGS="-g -O2"
>> PKG_CONFIG="pkg-config"
>> GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 
>> -fdebug-prefix-map=/tmp/go-build597193614=/tmp/go-build 
>> -gno-record-gcc-switches"
>> [clementauger@Host-001 jenjen-stream] $ sudo rm -fr /home/clementauger/
>> gow/pkg/mod/github.com/hashicorp/go-multierror@v1.0.0/
>> [clementauger@Host-001 jenjen-stream] $ sudo rm -fr /home/clementauger/
>> gow/pkg/mod/github.com/hashicorp/errwrap@v1.0.0/
>> [clementauger@Host-001 jenjen-stream] $ sudo rm -fr /home/clementauger/
>> gow/pkg/mod/github.com/hashicorp/
>> [clementauger@Host-001 jenjen-stream] $ cat go.mod 
>> module github.com/clementauger/jenjen-stream
>>
>> go 1.13
>>
>> require github.com/hashicorp/go-multierror v1.0.0
>> [clementauger@Host-001 jenjen-stream] $ go get ./...
>> go: extracting github.com/hashicorp/go-multierror v1.0.0
>> go: extracting github.com/hashicorp/errwrap v1.0.0
>> [clementauger@Host-001 jenjen-stream] $ ll /home/clementauger/gow/pkg/mod
>> /github.com/hashicorp/
>> total 8
>> dr-x-- 2 clementauger clementauger 4096 22 nov.  20:35 errwrap@v1.0.0
>> dr-x-- 2 clementauger clementauger 4096 22 nov.  20:35 go-
>> multierror@v1.0.0
>>
>> It also triggers a bug when i try to load that package using x/go/loader
>>
>> $ jenjen -template=github.com/clementauger/jenjen-stream -   "T => 
>> string, StreamT => StreamString, stream => streamString"
>> /home/clementauger/gow/pkg/mod/github.com/hashicorp/go-multierror@v1.0.0/
>> prefix.go:6:2: could not import github.com/hashicorp/errwrap (go/build: 
>> importGo github.com/hashicorp/errwrap: exit status 1
>> error writing go.mod: open /home/clementauger/gow/pkg/mod/github.com/
>> hashicorp/go-multierror@v1.0.0/go.mod298498081.tmp: permission denied
>>
>> )
>> 2019/11/22 20:37:34 couldn't load packages due to errors: 
>> github.com/hashicorp/go-multierror
>> panic: runtime error: invalid memory address or nil pointer 

Re: [go-nuts] early close of http.Client's Response.Body

2019-11-25 Thread Andy Balholm



> On Nov 25, 2019, at 9:54 AM, Liam  wrote:
> 
> - does the read-to-EOF stipulation also apply to Client.Get/Post() ?

Yes. Those methods are fairly simple wrappers around Do.

> - why does Response.Body.Close() before io.EOF not release unread buffers or 
> otherwise prepare it for persistence?

The connection can’t be reused for another request before all the data from the 
first request is read. The server is sending those bytes over the wire, and 
they need to go somewhere before another response can be read. So there were 
two options for how to implement Close when the whole body hasn’t been read:

1. Copy the rest of the body to /dev/null (or equivalent), and reuse the 
connection like normal.
2. Close the connection, thus communicating to the server that we don’t need 
that data after all.

Option 1 would generally be preferable for short responses, and option 2 for 
long ones. For consistency, and because we don’t always know the response 
length in advance (e.g. if it is chunked), it always does option 2.

Andy

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/228DAB0B-E2AB-4A5E-BBC5-76D611ED11F9%40gmail.com.


[go-nuts] early close of http.Client's Response.Body

2019-11-25 Thread Liam
Scenario:
Sending a client request and only reading the whole Response.Body for 
certain .StatusCode values, and/or reading only the first N bytes.

Docs for Client.Do()
"If the Body is not both read to EOF and closed, the Client's underlying 
RoundTripper (typically Transport) may not be able to re-use a persistent 
TCP connection..."

Docs for Client.Get/Post()
"Caller should close resp.Body when done reading from it."

Questions:
- does the read-to-EOF stipulation also apply to Client.Get/Post() ?
- why does Response.Body.Close() before io.EOF not release unread buffers 
or otherwise prepare it for persistence?

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/96d2e1d8-22e9-4cc0-99b2-b33721790773%40googlegroups.com.


[go-nuts] Re: ? How restrict usage of packages ?

2019-11-25 Thread JuciÊ Andrade
Add a script to your users continuous integration tool or even to their 
source control management.
Whenever software is compiled or commited your script will search for 
imports in Go source files.
If your script finds a forbidden package it should flag an error with a 
friendly message like this:

"You are NOT supposed to write full blown Go, but only Daniel's NearlyGo, 
that nowadays disallows importing package X, for your own good. In case you 
get angry please take out your pants and jump vigorously stepping on it 
again and again until you have your rage diminished somewhat. Only then, 
contact Daniel."


-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/d4982fb3-7c7c-4c6b-b7c1-5e9d9f9cba80%40googlegroups.com.


Re: [go-nuts] looking for a snippet to get started with Tcell or Termbox-go

2019-11-25 Thread Robert Engels
Use gcui. Check out github.com/robaho/go-trader for an example. 

> On Nov 25, 2019, at 11:23 AM, serge.hulne.bl...@gmail.com wrote:
> 
> 
> Hi,
> 
> I am looking for the easiest way to emulate ncurses using Go.
> 
> More precisely, I am looking for a snippet of code (an example basically) on 
> how to do the following:
> 
> "put a given character directly on a location (x,y) on a terminal" using 
> either Tcell or Termbox-go
> 
> 
> 
> or in pseudo-code:
> 
> put("X", x, y)
> 
> 
> 
> My aim is to build a "Game-of-life" like application. To this end I'll need 
> to e able to address randomly locations on a terminal.
> 
> PS: I am trying to avoid goncurses, for portability reasons.
> 
> Thanks in advance,
> Any help will be greatly appreciated.
> 
> 
> 
> 
> -- 
> 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.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/a2b17fb3-0774-44de-86bb-2937b06f2ca0%40googlegroups.com.

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/D4E80143-D8DD-4EBE-94EC-0BC9AF5D4E77%40ix.netcom.com.


[go-nuts] looking for a snippet to get started with Tcell or Termbox-go

2019-11-25 Thread serge . hulne . blues
Hi,

I am looking for the easiest way to emulate ncurses using Go.

More precisely, I am looking for a snippet of code (an example basically) 
on how to do the following:

"put a given character directly on a location (x,y) on a terminal" using 
either Tcell or Termbox-go



or in pseudo-code:

*put("X", x, y)*



My aim is to build a "Game-of-life" like application. To this end I'll need 
to e able to address randomly locations on a terminal.

PS: I am trying to avoid goncurses, for portability reasons.

Thanks in advance,
Any help will be greatly appreciated.




-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/a2b17fb3-0774-44de-86bb-2937b06f2ca0%40googlegroups.com.


[go-nuts] ? How restrict usage of packages ?

2019-11-25 Thread Daniel Norte Moraes
   Hi!

   I Want create and permite my users to create go lang programs mostly 
with full capabilities from
golang itself, but with some direct capabilities as net and filesystem 
striped from direct accesss; mostly 
capabilities as database access, and network access will be encapsuled in 
ours third parthy golang libs :-)
  The intent is use golang as a full-fledge compiled language and as 
substitute for a need a custom scripted language.
  
  Any sugestions and hints are wellcome! :-)


 Really Thanks 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/16198b6a-9954-4d5d-9d11-ff2865e31d11%40googlegroups.com.