Re: [go-nuts] Generic function aliases

2018-12-04 Thread messju mohr
Erm, function names may be const, but functions are first class citizen types and can of course be assigned to variables and be passed around. just my 2c On Tue, Dec 04, 2018 at 10:27:19AM -0800, Liam Breck wrote: >Ah yes, var works. But it should be const, since func names aren't >varia

Re: [go-nuts] [ANN] fixed point math library

2018-11-29 Thread messju mohr
Hello, this looks like a really nice and useful library! :) Just one thing: At first glance i saw that fixed.Cmp() returns 0 when both operands are NaN. I think it would be more consistent if fixed.Cmp() would return NaN if any of it's operands are NaN. just my 2ct messju On Thu, Nov 29, 201

Re: [go-nuts] Re: How to make the first character in a string lowercase?

2018-10-29 Thread messju mohr
I don't know if that is "the easiest", but I would do something like this: https://play.golang.org/p/DOhP5kc8rO4 On Sun, Oct 28, 2018 at 11:35:33PM -0700, dhananja...@gmail.com wrote: >https://play.golang.org/p/vFW8NxzL_hv >this will work fine >On Saturday, 24 November 2012 16:21:23 UT

Re: [go-nuts] Re: Examples testing with two newline, but only one newline

2018-08-13 Thread messju mohr
Here is a running version that shows the original poster's problem: On Mon, Aug 13, 2018 at 07:16:08AM -0700, gary.willoug...@victoriaplumb.com wrote: >Your program doesn't work. > >On Saturday, 11 August 2018 09:10:04 UTC+1, 子風 wrote: > > Hi

Re: [go-nuts] Re: Set LD_LIBRARY_PATH while executing go test

2017-06-16 Thread messju mohr
... and a shell agnostic way would be: $ env LD_LIBRARY_PATH=/foo/bar go test (see the man page of env(1)) regards On Fri, Jun 16, 2017 at 04:12:15AM -0700, Uli Kunitz wrote: >Bash supports: >``` >LD_LIBRARY_PATH=/foo/bar go test  >``` >Is that what you want? -- You recei

Re: [go-nuts] remove last index of character from string and also want use strings.LastIndex(s, sep string)

2017-05-29 Thread messju mohr
:06:10 PM UTC+8, messju mohr wrote: > > Hi, > > On Fri, May 26, 2017 at 07:10:43AM -0700, [1]long...@gmail.com wrote: > >    var str = "a/b/c/d/c" > >    // I want remove last chracter from str > >  

Re: [go-nuts] remove last index of character from string and also want use strings.LastIndex(s, sep string)

2017-05-26 Thread messju mohr
Hi, On Fri, May 26, 2017 at 07:10:43AM -0700, long.a...@gmail.com wrote: >var str = "a/b/c/d/c" >// I want remove last chracter from str >var strRunes = []rune(str) >var newStrRunes = strRunes[0 : len(strRunes)-1] >//

Re: [go-nuts] Possible optimization bug in go1.8?

2017-05-08 Thread messju mohr
ound... >On Mon, May 8, 2017 at 10:21 AM, Decker, Ryan C. <[2]rdec...@siena.edu> >wrote: > > I usually follow the example and go with time.Now().UnixNano() which you > can see here: > On Mon, May 8, 2017 at 10:07 AM, messju mohr > <[3]mes...

Re: [go-nuts] Possible optimization bug in go1.8?

2017-05-08 Thread messju mohr
Hi, in xrand() you are initialising r with the same constant seed for every call, so you always get the same pseudo random number. See: cheers messju On Mon, May 08, 2017 at 03:26:08AM -0700, sivarajshabin...@gmail.com wrote: >Hi All, > >Firstly,

Re: [go-nuts] fmt verb to single quote text

2017-01-06 Thread messju mohr
If you want to generate javascript code I suggest the encoding/json package from the stdlib. Like: https://play.golang.org/p/vHKcCfWJPz On Thu, Jan 05, 2017 at 09:06:06AM -0800, bsr wrote: >Alexander. thank you very much for helping out.  >your program does output my desired string, but v