[go-nuts] Re: [ANN] Gomail v2: sending emails faster

2019-04-06 Thread axllowlord
hi, i use this code, I can't make it work help Could you tell me how to properly use your library on this code, and set an example for a custom dealer, so that I can access the smtp through a proxy (sock4, sock4a, or sock5)? is it possible? please a couple of lines of code for an example func

[go-nuts] CompileError: AsyncCompile: Wasm decoding failed

2019-04-06 Thread Jon Killebrew
Having issues getting WebAssembly (example at https://github.com/golang/go/wiki/WebAssembly). I am running a test website on the Google App Engine, and the website is running on Go. I created all the objects according to the documentation provided on the page. Now, I'm getting this error wh

Re: [go-nuts] What happens when you call another method within a method set at the end of a method

2019-04-06 Thread Robert Engels
You are correct, but I think an explicit stack is faster than most function calls, but it depends on number of parameters needed, etc. but maybe not...:) > On Apr 6, 2019, at 12:20 PM, Ian Denhardt wrote: > > Quoting Robert Engels (2019-04-06 08:00:02) > >> But yes, similar to how all recur

Re: [go-nuts] Some issues with UDP and Go

2019-04-06 Thread Mhd Shulhan
On Sun, 7 Apr 2019, 04:24 John Dreystadt, wrote: > I wrote some sample code (at the end of this message) to see how UDP > worked in the Go environment. And I wound up with some issues because > things did not seem to work as I expected. I am running go1.11.2 on both a > Windows box and a Ubuntu b

[go-nuts] Some issues with UDP and Go

2019-04-06 Thread John Dreystadt
I wrote some sample code (at the end of this message) to see how UDP worked in the Go environment. And I wound up with some issues because things did not seem to work as I expected. I am running go1.11.2 on both a Windows box and a Ubuntu box. Issue 1, when I call WriteMsgUDP with both a regula

[go-nuts] Re: Help wanted - ReferenceError: Go is not defined error

2019-04-06 Thread jon . killebrew
Solved! Thank you so much, can't believe I missed that. On Saturday, April 6, 2019 at 2:12:45 PM UTC-5, Agniva De Sarker wrote: > > Remove the async attribute from your script tag. > > On Saturday, 6 April 2019 23:38:17 UTC+5:30, jon.ki...@gmail.com wrote: >> >> I am new to Go programming. I s

Re: [go-nuts] What happens when you call another method within a method set at the end of a method

2019-04-06 Thread Michael Jones
The opportunity to optimize yb tail-call elimination comes up in my coding from time to time. It is generally trivial to do but sometimes less so, and this example by Ian Denhardt is one I'd never considered and one that would make doing the rewrite yourself impossible. Generally though it is ver

[go-nuts] Re: Help wanted - ReferenceError: Go is not defined error

2019-04-06 Thread Agniva De Sarker
Remove the async attribute from your script tag. On Saturday, 6 April 2019 23:38:17 UTC+5:30, jon.ki...@gmail.com wrote: > > I am new to Go programming. I stumbled across a project for using > WeAssembly at https://github.com/golang/go/wiki/WebAssembly and decided > to give it a try. So I'm ru

[go-nuts] Help wanted - ReferenceError: Go is not defined error

2019-04-06 Thread jon . killebrew
I am new to Go programming. I stumbled across a project for using WeAssembly at https://github.com/golang/go/wiki/WebAssembly and decided to give it a try. So I'm running a test website on the Google App Engine, and the website is running on Go. I created all the objects according to the doc

Re: [go-nuts] what does p stand for in io.Reader.Read argument

2019-04-06 Thread Santhosh T
now it makes sense. thanks Santhosh On Sat, Apr 6, 2019 at 11:20 PM andrey mirtchovski wrote: > It may help to note that in the earliest references to the Read > interface in the history of the language it accepted a *[]byte, hence > 'p' may indeed stand for pointer. > > > https://github.com/go

Re: [go-nuts] what does p stand for in io.Reader.Read argument

2019-04-06 Thread andrey mirtchovski
It may help to note that in the earliest references to the Read interface in the history of the language it accepted a *[]byte, hence 'p' may indeed stand for pointer. https://github.com/golang/go/commit/7c9e2c2b6c2e0aa3090dbd5183809e1b2f53359b#diff-bf734f53a84f388bf39699d291b06b1d -- You receiv

Re: [go-nuts] what does p stand for in io.Reader.Read argument

2019-04-06 Thread Santhosh T
ok. got it my thinking is 'b' is obvious choice, then why invent new name 'p' ? On Sat, Apr 6, 2019 at 11:15 PM Jan Mercl <0xj...@gmail.com> wrote: > It can be whatever you like: passedBuf, payload, putBuffer, param, > pointer, ... > > It does not have to represent any word after all. Naming is

Re: [go-nuts] what does p stand for in io.Reader.Read argument

2019-04-06 Thread Jan Mercl
It can be whatever you like: passedBuf, payload, putBuffer, param, pointer, ... It does not have to represent any word after all. Naming is hard, but in the case of a single argument it does not matter that much, so it could be just a case of author's C habits: void *p for buffers. On Sat, Apr 6,

Re: [go-nuts] what does p stand for in io.Reader.Read argument

2019-04-06 Thread Santhosh T
seems my question is not clear. my question is regarding naming of variables. i know that single name variables in go is idiomatic. r for reader w for writer etc... Read(p []byte) (n int, err error) i dont get why argument is named 'p' instead of 'b'. there should be some reasoning. I dont get w

Re: [go-nuts] What happens when you call another method within a method set at the end of a method

2019-04-06 Thread Ian Denhardt
Quoting Robert Engels (2019-04-06 08:00:02) >But yes, similar to how all recursive functions can be rewritten using >loops, which are more efficient, that is essentially what tail call >optimization does - just that the process it automatic. Not all recursive functions -- just tail ca

Re: [go-nuts] what does p stand for in io.Reader.Read argument

2019-04-06 Thread Philip Chapman
p is the array of bytes that you want to fill with data read. The method returns the count of the number of bytes read which may be any value from zero to p's length. You must make multiple reads if the thing being read from holds more data than your buffer array can hold. On Sat, Apr 6, 2019 at

[go-nuts] what does p stand for in io.Reader.Read argument

2019-04-06 Thread Santhosh T
Hi, method in io.Reader interface is: Read(p []byte) (n int, err error) what does `p` stands for ? thanks Santhosh -- 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 em

[go-nuts] Re: Persistent memory support for Go

2019-04-06 Thread rlh
Out of curiosity what HW/OS is this being developed on? I need new HW and might as well get the same since it will make playing around with this smoother. On Wednesday, April 3, 2019 at 6:35:13 PM UTC-4, Jerrin Shaji George wrote: > > Hi, > > > > I am part of a small team at VMware working on

[go-nuts] Re: [golang-dev] does net.Conn.SetDeadLine makes syscall ?

2019-04-06 Thread Dave Cheney
In this case it looks like to be correct you must set the deadline before reading from the network, and given reading from the network can block, the cost of setting the deadline is small. On Sat, 6 Apr 2019 at 21:47, Santhosh T wrote: > > Hi Dave, > > my mistake, bufr is backed by net.Conn > > b

Re: [go-nuts] What happens when you call another method within a method set at the end of a method

2019-04-06 Thread Robert Engels
But yes, similar to how all recursive functions can be rewritten using loops, which are more efficient, that is essentially what tail call optimization does - just that the process it automatic. > On Apr 6, 2019, at 5:21 AM, Jan Mercl <0xj...@gmail.com> wrote: > > On Sat, Apr 6, 2019 at 9:34 A

[go-nuts] Re: [golang-dev] does net.Conn.SetDeadLine makes syscall ?

2019-04-06 Thread Santhosh T
Hi Dave, I agree with you thanks Santhosh On Sat, Apr 6, 2019 at 4:22 PM Dave Cheney wrote: > In this case it looks like to be correct you must set the deadline > before reading from the network, and given reading from the network > can block, the cost of setting the deadline is small. > > On

[go-nuts] Re: [golang-dev] does net.Conn.SetDeadLine makes syscall ?

2019-04-06 Thread Santhosh T
Hi Dave, my mistake, bufr is backed by net.Conn bufr := bufio.newReader(netConn) for numEntries >0 { numEntries-- netConn.setReadDeadline(timeNow().add(heartbeatTimeout) entry.decode(bufr) process(entry) } thanks Santhosh On Sat, Apr 6, 2019 at 4:09 PM Dave Cheney wrote: > Tha

Re: [go-nuts] What happens when you call another method within a method set at the end of a method

2019-04-06 Thread Jan Mercl
On Sat, Apr 6, 2019 at 9:34 AM Louki Sumirniy < louki.sumirniy.stal...@gmail.com> wrote: A tail call is in the first approximation just what it says: call foo ret Nothing other is really that much special about it. -- You received this message because you are subscribed to the

[go-nuts] What happens when you call another method within a method set at the end of a method

2019-04-06 Thread Louki Sumirniy
I have become quite interested in tail-call optimisation and more distantly in code that assembles trees of closures all tied to the same scope through parameters to reduce stack management for complex but not always predictable input. As I have learned from some reading, tail call optimisation