Re: [go-nuts] Odd error message - expression in go must be function call

2020-04-23 Thread Ian Lance Taylor
On Thu, Apr 23, 2020 at 9:35 AM Matthew Zimmerman  wrote:
>
> Reported, thank you!
>
> https://github.com/golang/go/issues/38624

Thanks!

Ian


 On Thu, Apr 23, 2020 at 12:16 PM Ian Lance Taylor  wrote:
>>
>> On Thu, Apr 23, 2020 at 7:30 AM Matthew Zimmerman  
>> wrote:
>> >
>> > I was really confused by this error for ~10 minutes or so.  Usually when 
>> > this happens to me, I missed a closing/opening brace somewhere or I forgot 
>> > to add () after my anonymous function declaration to actually run it.
>> >
>> > This time though all the braces were lining up and I had () there 
>> > appropriately.  I finally gave up on that error and started working on the 
>> > next one and when I looked there (using if instead of for with the range 
>> > operator) I realized I had a bug fixed it and my first error went away too.
>> >
>> > Not sure if this is anything to be too worried about, but I found it 
>> > confusing and wasn't sure if this was worth a bug report or not.
>> >
>> > It's easily reproducible: https://play.golang.org/p/DJKZqMtng4S
>> >
>> > Change line 13 from if to for and everything works.
>> >
>> > Great project/language, thanks for everyone's work on it!
>>
>> Thanks.  Can you file a bug report for this at
>> https://golang.org/issue ?  I agree that we should do better here.
>>
>> 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/CAOyqgcWVJGv4i0hdU_BKqREbFdvhZVK3sP3k-oRE7u8wHbVMMw%40mail.gmail.com.


Re: [go-nuts] Why isn't there "number plus" postfix syntax for more than or equal?

2020-04-23 Thread anon notmyfault64
In this context, this number plus syntax short-circuit more than or equal, 
so

a 99+

is same as

a >= 99



On Thursday, April 23, 2020 at 11:43:32 PM UTC+7, Ian Lance Taylor wrote:
>
> On Thu, Apr 23, 2020 at 8:48 AM anon notmyfault64  > wrote: 
> > 
> > Many times outside programming we use "number plus" postfix syntax to 
> denote more than or equal, for example: 
> > 
> > a 99+ 
> > 
> > But why isn't there such syntax above in all programming languages, 
> including Go? That is, why does following code not compile with invalid 
> syntax error? 
> > 
> > var r int = 18 
> > 
> > if r 13+ { 
> > fmt.Println("Hooray! We are teen! We can do anything!") 
> > } else { 
> > fmt.Println("Oh No! We are still child, so we need parental 
> control!") 
> > } 
>
> I don't see the advantage over writing r >= 13. 
>
> It's not useful for a programming language to have multiple ways of 
> writing the exact same thing.  Of course, any language does have 
> multiple ways of doing some things, but there is should always be a 
> reason for it.  I don't see a reason for this one. 
>
> For what it's worth, I'm not familiar with the "a 99+" notation.  I 
> would not know what that meant without an explanation. 
>
> 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/77d05b4d-6743-48ed-affa-b6fb66d13500%40googlegroups.com.


Re: [go-nuts] Why isn't there "number plus" postfix syntax for more than or equal?

2020-04-23 Thread Rob Pike
if r == 13 despiteallobjections { ... }

-rob


On Fri, Apr 24, 2020 at 8:04 AM 'Dan Kortschak' via golang-nuts <
golang-nuts@googlegroups.com> wrote:

> I look forward to the addition of the definition of "in a handwavy
> sense" to the spec.
>
> On Thu, 2020-04-23 at 11:41 -0700, Michael Jones wrote:
> > You could extend the notation:
> >
> > If r 13+- {
> >   // if r is close to 13, in a handwavy sense
> >   :
> > }
> >
> > On Thu, Apr 23, 2020 at 9:43 AM Ian Lance Taylor 
> > wrote:
> > > On Thu, Apr 23, 2020 at 8:48 AM anon notmyfault64 <
> > > bagasdo...@gmail.com> wrote:
> > > >
> > > > Many times outside programming we use "number plus" postfix
> > > syntax to denote more than or equal, for example:
> > > >
> > > > a 99+
> > > >
> > > > But why isn't there such syntax above in all programming
> > > languages, including Go? That is, why does following code not
> > > compile with invalid syntax error?
> > > >
> > > > var r int = 18
> > > >
> > > > if r 13+ {
> > > > fmt.Println("Hooray! We are teen! We can do anything!")
> > > > } else {
> > > > fmt.Println("Oh No! We are still child, so we need parental
> > > control!")
> > > > }
> > >
> > > I don't see the advantage over writing r >= 13.
> > >
> > > It's not useful for a programming language to have multiple ways of
> > > writing the exact same thing.  Of course, any language does have
> > > multiple ways of doing some things, but there is should always be a
> > > reason for it.  I don't see a reason for this one.
> > >
> > > For what it's worth, I'm not familiar with the "a 99+" notation.  I
> > > would not know what that meant without an explanation.
> > >
> > > 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/dd0eb4cfb15efb25b2ea374ace24a3268df2ebc5.camel%40kortschak.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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOXNBZRUU7RwAxYXqHnrnFvOywC%3DtAbZL_1rcL6T6m91N%3DvLRQ%40mail.gmail.com.


[go-nuts] sshagentca : project code review/security audit advice

2020-04-23 Thread roryclw
I've written my second(!) go project, an ssh certificate authority for 
forwarded ssh connections.

https://github.com/rorycl/sshagentca

The idea for the project came from Peter Moody's posting about uber's pam 
module for ssh forwarded agents with certificates:
https://medium.com/uber-security-privacy/introducing-the-uber-ssh-certificate-authority-4f840839c5cc
The facebook post about using certificate principals for zones is also 
interesting:
https://engineering.fb.com/security/scalable-and-secure-access-with-ssh/

It's a small project, but can make a big difference to ssh-related 
workflows, providing time-scoped, user-specific ssh certificates.

I'd be grateful for some ideas on how to improve the code. I'm specifically 
interested in how one might go about auditing the project from a security 
standpoint.

Rory

-- 
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/e5ce0979-3bd3-4b60-a6a1-94c25e625fc6%40googlegroups.com.


Re: [go-nuts] Why isn't there "number plus" postfix syntax for more than or equal?

2020-04-23 Thread 'Dan Kortschak' via golang-nuts
I look forward to the addition of the definition of "in a handwavy
sense" to the spec.

On Thu, 2020-04-23 at 11:41 -0700, Michael Jones wrote:
> You could extend the notation:
> 
> If r 13+- {
>   // if r is close to 13, in a handwavy sense
>   :
> }
> 
> On Thu, Apr 23, 2020 at 9:43 AM Ian Lance Taylor 
> wrote:
> > On Thu, Apr 23, 2020 at 8:48 AM anon notmyfault64 <
> > bagasdo...@gmail.com> wrote:
> > >
> > > Many times outside programming we use "number plus" postfix
> > syntax to denote more than or equal, for example:
> > >
> > > a 99+
> > >
> > > But why isn't there such syntax above in all programming
> > languages, including Go? That is, why does following code not
> > compile with invalid syntax error?
> > >
> > > var r int = 18
> > >
> > > if r 13+ {
> > > fmt.Println("Hooray! We are teen! We can do anything!")
> > > } else {
> > > fmt.Println("Oh No! We are still child, so we need parental
> > control!")
> > > }
> > 
> > I don't see the advantage over writing r >= 13.
> > 
> > It's not useful for a programming language to have multiple ways of
> > writing the exact same thing.  Of course, any language does have
> > multiple ways of doing some things, but there is should always be a
> > reason for it.  I don't see a reason for this one.
> > 
> > For what it's worth, I'm not familiar with the "a 99+" notation.  I
> > would not know what that meant without an explanation.
> > 
> > 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/dd0eb4cfb15efb25b2ea374ace24a3268df2ebc5.camel%40kortschak.io.


Re: [go-nuts] pprof samples

2020-04-23 Thread asaxena via golang-nuts
The program is indeed IO and network bound so it does seem the CPU usage is 
minimal. 

Thanks for all the pointers for tracing and analyzing !!

On Wednesday, April 22, 2020 at 2:45:57 PM UTC-7, Robert Engels wrote:
>
> pprof is not only cpu profiling - it is the same tracing infrastructure 
> used in the go analyzer. 
>
> On Apr 22, 2020, at 2:28 PM, David Finkel  > wrote:
>
> 
>
>
> On Mon, Apr 20, 2020 at 8:35 PM asaxena via golang-nuts <
> golan...@googlegroups.com > wrote:
>
>> Hi,
>>
>> I am trying CPU profiling a program that runs for an hour. However when I 
>> start pprof it says Total samples are only for 1.32 min. Why are the 
>> samples not collected for the whole duration of the program ? Is there a 
>> missing setting I need to enable ?
>>
> It sounds like it was collected fro the duration of the program (see 
> below), no additional configuration needed. 
>
>>
>> Duration: 1.14hrs, Total samples = 1.32mins ( 1.94%) 
>>
> This generally means that your process only used (roughly) 1.32 minutes of 
> CPU-time over the 1.14hrs of the profile. Equivalent to an average 
> CPU-usage of the 1.94% it listed.
> My usual inference from this kind of profile is that this program is not 
> CPU-bound and instead I/O or network-bound.
>
> CPU-profiling is only useful for debugging cpu-bound operations, it 
> doesn't tell you where operations were blocked, contending, etc.
> Diego's suggestion of instrumenting your code with some sort of metrics 
> library (I'm a fan of opencensus's stats 
>  + prometheus 
> ) is rather useful for tracking aggregate stats.
>
> In general, though, if you have a specific request/process you want to 
> find the bottleneck in, it's hard to get away from tracing. I've used 
> opentracing 
> with Zipkin 
> ,
>  
> but most recently I use opencensus tracing 
>  with stackdriver 
> . 
> For a single process, though I just use opencensus's zpages 
>  to get a view of the current 
> trace-spans on that process.
>
>>
>> Thanks.
>>
>> -- 
>> 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/a13db751-0f65-4b0b-aaf3-f39bc29e21cf%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/CANrC0BizHrEy73JWJZHPrVx2Wb91z0vPj87HgLcg6nu1ydg0Mg%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/02a8d88a-7fe5-46e6-b64c-39c5a2a079d0%40googlegroups.com.


Re: [go-nuts] Why isn't there "number plus" postfix syntax for more than or equal?

2020-04-23 Thread Michael Jones
You could extend the notation:

If r 13+- {
  // if r is close to 13, in a handwavy sense
  :
}

On Thu, Apr 23, 2020 at 9:43 AM Ian Lance Taylor  wrote:

> On Thu, Apr 23, 2020 at 8:48 AM anon notmyfault64 
> wrote:
> >
> > Many times outside programming we use "number plus" postfix syntax to
> denote more than or equal, for example:
> >
> > a 99+
> >
> > But why isn't there such syntax above in all programming languages,
> including Go? That is, why does following code not compile with invalid
> syntax error?
> >
> > var r int = 18
> >
> > if r 13+ {
> > fmt.Println("Hooray! We are teen! We can do anything!")
> > } else {
> > fmt.Println("Oh No! We are still child, so we need parental
> control!")
> > }
>
> I don't see the advantage over writing r >= 13.
>
> It's not useful for a programming language to have multiple ways of
> writing the exact same thing.  Of course, any language does have
> multiple ways of doing some things, but there is should always be a
> reason for it.  I don't see a reason for this one.
>
> For what it's worth, I'm not familiar with the "a 99+" notation.  I
> would not know what that meant without an explanation.
>
> 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/CAOyqgcWm5jaEa36FMqLaea22BTB_WwZOsZpwrW1ei1N_KN64eg%40mail.gmail.com
> .
>
-- 

*Michael T. jonesmichael.jo...@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/CALoEmQzf754cub_eNsxtPXmbbnawFMc82-eiTqygBxW8231dcg%40mail.gmail.com.


Re: [go-nuts] Why isn't there "number plus" postfix syntax for more than or equal?

2020-04-23 Thread Ian Lance Taylor
On Thu, Apr 23, 2020 at 8:48 AM anon notmyfault64  wrote:
>
> Many times outside programming we use "number plus" postfix syntax to denote 
> more than or equal, for example:
>
> a 99+
>
> But why isn't there such syntax above in all programming languages, including 
> Go? That is, why does following code not compile with invalid syntax error?
>
> var r int = 18
>
> if r 13+ {
> fmt.Println("Hooray! We are teen! We can do anything!")
> } else {
> fmt.Println("Oh No! We are still child, so we need parental control!")
> }

I don't see the advantage over writing r >= 13.

It's not useful for a programming language to have multiple ways of
writing the exact same thing.  Of course, any language does have
multiple ways of doing some things, but there is should always be a
reason for it.  I don't see a reason for this one.

For what it's worth, I'm not familiar with the "a 99+" notation.  I
would not know what that meant without an explanation.

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/CAOyqgcWm5jaEa36FMqLaea22BTB_WwZOsZpwrW1ei1N_KN64eg%40mail.gmail.com.


[go-nuts] Re: gomobile icon, storage, startup warning

2020-04-23 Thread hermanbergwerf
For the icons I found out about `assets/icon.png` by looking at the
source code, unfortunately it has a small side-effect for me
(https://github.com/golang/go/issues/38615)

On Thursday, 23 April 2020 17:51:35 UTC+2, Herman Bergwerf wrote:
>
> I want to build a simple game about permutations, and gomobile native 
> looks like a relief! (I resent having 10 nested folders and 4 configuration 
> files just to get started). I would love to build and publish an small game 
> in Go :)
>
> I have a few questions, perhaps someone here can help me with them:
> - Is it possible to set an app icon? (I tried adding one in the manifest, 
> but it said manual icons were not supported).
> - What would be the best way to store app state? (in this case the puzzle 
> state) I was thinking about asking for file permissions, and then use some 
> deterministic procedure to find a suitable location to store a small json 
> file.
> - When I first launch an app, it gives a warning that the app was built 
> for an older platform, can I get rid of this? I believe I updated my 
> android SDK and NDK to the latest version.
>

-- 
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/9d93bbc8-fdf1-4bb2-9bc1-f7434c318963%40googlegroups.com.


Re: [go-nuts] gomobile icon, storage, startup warning

2020-04-23 Thread Herman Bergwerf
For the icons I found out about `assets/icon.png` by looking at the
source code, unfortunately it has a small side-effect for me
(https://github.com/golang/go/issues/38615)

On Thu, 23 Apr 2020 at 17:51,  wrote:
>
> I want to build a simple game about permutations, and gomobile native looks 
> like a relief! (I resent having 10 nested folders and 4 configuration files 
> just to get started). I would love to build and publish an small game in Go :)
>
> I have a few questions, perhaps someone here can help me with them:
> - Is it possible to set an app icon? (I tried adding one in the manifest, but 
> it said manual icons were not supported).
> - What would be the best way to store app state? (in this case the puzzle 
> state) I was thinking about asking for file permissions, and then use some 
> deterministic procedure to find a suitable location to store a small json 
> file.
> - When I first launch an app, it gives a warning that the app was built for 
> an older platform, can I get rid of this? I believe I updated my android SDK 
> and NDK to the latest version.
>
> --
> You received this message because you are subscribed to a topic in the Google 
> Groups "golang-nuts" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/golang-nuts/c8Htf-cU6XA/unsubscribe.
> To unsubscribe from this group and all its topics, 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/e7b54d1e-0cc8-46ee-9461-47a6cfe82dc7%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/CAPAjOT1%2BWigPWyPBcTWVOmRx3YAYHeQUC_SVL82sz-JvH3oJtA%40mail.gmail.com.


Re: [go-nuts] Odd error message - expression in go must be function call

2020-04-23 Thread Matthew Zimmerman
Reported, thank you!

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

On Thu, Apr 23, 2020 at 12:16 PM Ian Lance Taylor  wrote:

> On Thu, Apr 23, 2020 at 7:30 AM Matthew Zimmerman 
> wrote:
> >
> > I was really confused by this error for ~10 minutes or so.  Usually when
> this happens to me, I missed a closing/opening brace somewhere or I forgot
> to add () after my anonymous function declaration to actually run it.
> >
> > This time though all the braces were lining up and I had () there
> appropriately.  I finally gave up on that error and started working on the
> next one and when I looked there (using if instead of for with the range
> operator) I realized I had a bug fixed it and my first error went away too.
> >
> > Not sure if this is anything to be too worried about, but I found it
> confusing and wasn't sure if this was worth a bug report or not.
> >
> > It's easily reproducible: https://play.golang.org/p/DJKZqMtng4S
> >
> > Change line 13 from if to for and everything works.
> >
> > Great project/language, thanks for everyone's work on it!
>
> Thanks.  Can you file a bug report for this at
> https://golang.org/issue ?  I agree that we should do better here.
>
> 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/CAD53Lr7LWzER6swFot60u2tMtVXvUA%3DVmDud9jXqq7Cevv8b8Q%40mail.gmail.com.


Re: [go-nuts] Odd error message - expression in go must be function call

2020-04-23 Thread Ian Lance Taylor
On Thu, Apr 23, 2020 at 7:30 AM Matthew Zimmerman  wrote:
>
> I was really confused by this error for ~10 minutes or so.  Usually when this 
> happens to me, I missed a closing/opening brace somewhere or I forgot to add 
> () after my anonymous function declaration to actually run it.
>
> This time though all the braces were lining up and I had () there 
> appropriately.  I finally gave up on that error and started working on the 
> next one and when I looked there (using if instead of for with the range 
> operator) I realized I had a bug fixed it and my first error went away too.
>
> Not sure if this is anything to be too worried about, but I found it 
> confusing and wasn't sure if this was worth a bug report or not.
>
> It's easily reproducible: https://play.golang.org/p/DJKZqMtng4S
>
> Change line 13 from if to for and everything works.
>
> Great project/language, thanks for everyone's work on it!

Thanks.  Can you file a bug report for this at
https://golang.org/issue ?  I agree that we should do better here.

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/CAOyqgcXK6-x%3DMytUoUTW-UXepD_6-dajeL5zo5Q-gYQJrOU3Bg%40mail.gmail.com.


Re: [go-nuts] Missing math.MinFloat64

2020-04-23 Thread Ian Lance Taylor
On Thu, Apr 23, 2020 at 8:48 AM Amarjeet Anand  wrote:
>
> Like math.MaxFloat64, Why don't math.MinFloat64 exist?

Unlike integers, for floating point numbers MinFloat64 == -
MaxFloat64.  So adding MinFloat64 doesn't seem necessary.

Of course this assumes that you are aware of that fact.  Maybe we
should add a sentence to the doc.

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/CAOyqgcWcu3Ts%2BrzFLx0rf_5Y08enpzNOrcC8JxgNZAV5o60zdA%40mail.gmail.com.


[go-nuts] gomobile icon, storage, startup warning

2020-04-23 Thread hermanbergwerf
I want to build a simple game about permutations, and gomobile native looks 
like a relief! (I resent having 10 nested folders and 4 configuration files 
just to get started). I would love to build and publish an small game in Go 
:)

I have a few questions, perhaps someone here can help me with them:
- Is it possible to set an app icon? (I tried adding one in the manifest, 
but it said manual icons were not supported).
- What would be the best way to store app state? (in this case the puzzle 
state) I was thinking about asking for file permissions, and then use some 
deterministic procedure to find a suitable location to store a small json 
file.
- When I first launch an app, it gives a warning that the app was built for 
an older platform, can I get rid of this? I believe I updated my android 
SDK and NDK to the latest version.

-- 
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/e7b54d1e-0cc8-46ee-9461-47a6cfe82dc7%40googlegroups.com.


[go-nuts] Missing math.MinFloat64

2020-04-23 Thread Amarjeet Anand
Hi

Like *math.MaxFloat64*, Why don't *math.MinFloat64* exist?

-- 
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/CAORUUQWLVC%2Bi%2B-OrKC-ROpKuon-aAFx4tFJase%3DjNEGV_wCqDw%40mail.gmail.com.


[go-nuts] Why isn't there "number plus" postfix syntax for more than or equal?

2020-04-23 Thread anon notmyfault64
Hello,

Many times outside programming we use "number plus" postfix syntax to 
denote more than or equal, for example:

a 99+

But why isn't there such syntax above in all programming languages, 
including Go? That is, why does following code not compile with invalid 
syntax error?

var r int = 18

if r 13+ {
fmt.Println("Hooray! We are teen! We can do anything!")
} else {
fmt.Println("Oh No! We are still child, so we need parental control!")
}


-- 
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/b12b55b0-10e8-4eb6-a902-aeec3132f486%40googlegroups.com.


Re: [go-nuts] Odd error message - expression in go must be function call

2020-04-23 Thread Mhd Shulhan
Pada tanggal Kam, 23 Apr 2020 21.30, Matthew Zimmerman 
menulis:

> I was really confused by this error for ~10 minutes or so.  Usually when
> this happens to me, I missed a closing/opening brace somewhere or I forgot
> to add () after my anonymous function declaration to actually run it.
>
> This time though all the braces were lining up and I had () there
> appropriately.  I finally gave up on that error and started working on the
> next one and when I looked there (using if instead of for with the range
> operator) I realized I had a bug fixed it and my first error went away too.
>
> Not sure if this is anything to be too worried about, but I found it
> confusing and wasn't sure if this was worth a bug report or not.
>
> It's easily reproducible: https://play.golang.org/p/DJKZqMtng4S
>
>
After reading several sentences, I just click the link and can't figured
out where the mistake was, and then I read your full email to realize where
the error was.

Here is another example of confusing error message that I found just today,

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

You may find the mistake easily by first glance. Usually error like this
happen if you have many lines of code with static string here and there,
and one single typo.

-- 
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/CAMh9%2BYCP2NPyWYU56OGp4kMjs15-pFW0GkXhj1OLp_xsZxhyvA%40mail.gmail.com.


[go-nuts] Odd error message - expression in go must be function call

2020-04-23 Thread Matthew Zimmerman
I was really confused by this error for ~10 minutes or so.  Usually when
this happens to me, I missed a closing/opening brace somewhere or I forgot
to add () after my anonymous function declaration to actually run it.

This time though all the braces were lining up and I had () there
appropriately.  I finally gave up on that error and started working on the
next one and when I looked there (using if instead of for with the range
operator) I realized I had a bug fixed it and my first error went away too.

Not sure if this is anything to be too worried about, but I found it
confusing and wasn't sure if this was worth a bug report or not.

It's easily reproducible: https://play.golang.org/p/DJKZqMtng4S

Change line 13 from if to for and everything works.

Great project/language, thanks for everyone's work on 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/CAD53Lr7%3Dki_tvkNp%2B5MFkDquF1rvvtW62BJmSSpQk7W4tQh6Jw%40mail.gmail.com.


[go-nuts] go module local development problem with replace directive in go.mod

2020-04-23 Thread aihui zhu
for example A deps B and B deps C
adds replace B => local/path/to/B in A/go.mod and replace C => 
local/path/to/C in B/go.mod
changes C doesn't rebuilds A.

it's it a bug or work as intend? 

how could i make rebuild works, otherwise i may need to create git commits, 
update A and B package again and again.

-- 
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/a21791a5-8cbe-406e-ae45-223d3eba727f%40googlegroups.com.