[go-nuts] Ternary ... again

2018-08-14 Thread Mark Volkmann
a good idea if the values come from function calls since there would sometimes be needless function calls. var color = “blue” if temperature > 100 { color = “red” } --- R. Mark Volkmann Object Computing, Inc. -- You received this message because you are subscribed to the Google Groups &qu

Re: [go-nuts] Ternary ... again

2018-08-15 Thread Mark Volkmann
it on real projects. Getting more developers to consider Go makes that more likely. --- R. Mark Volkmann Object Computing, Inc. > On Aug 14, 2018, at 12:18 PM, Axel Wagner > wrote: > > There is lots of discussion findable here: > https://groups.google.com/forum/#!searchi

[go-nuts] reflect to get value type of a map

2018-08-30 Thread Mark Volkmann
I see that I can use the `reflect` package to get the key type of a map like this: ```go mt := reflect.TypeOf(myMap) fmt.Println("key type is", mt.Key()) ``` But I don't see a way to get the value type of a map. Is there a method to do this? -- R. Mark Volkmann Object Computing

Re: [go-nuts] Re: Opening brace can't be placed on a separate line killing the language for me

2018-09-08 Thread Mark Volkmann
How did you do that? I don’t see any formatting configuration. --- R. Mark Volkmann Object Computing, Inc. > On Sep 8, 2018, at 3:48 AM, Jan Mercl <0xj...@gmail.com> wrote: > > On Sat, Sep 8, 2018 at 10:14 AM Dave Cheney wrote: > > > I personally don't like

[go-nuts] Go modules and replace

2018-10-19 Thread Mark Volkmann
main.go" in the directory of the demo code I get build demo: cannot find module for path foo/bar Is there something wrong with my use of the "replace" directive? None of this code is under the directory pointed to by GOPATH because I'm trying to use Go modules for everything

Re: [go-nuts] Go modules and replace

2018-10-19 Thread Mark Volkmann
> On Oct 19, 2018, at 4:48 PM, Justin Israel wrote: > > > >> On Sat, Oct 20, 2018, 9:42 AM Mark Volkmann >> wrote: >> I have a simple demo application that wants to use a package that is on my >> local file system. >> The code for the package is

Re: [go-nuts] Go modules and replace

2018-10-19 Thread Mark Volkmann
bar > $ cat go.mod > module example.com/foo > > require example.com/bar v0.0.0 > > replace example.com/bar => /root/bar > $ go run . > Hello from bar! > On Fri, 19 Oct 2018 at 21:42, Mark Volkmann > wrote: > > > > I have a simple demo application that want

Re: [go-nuts] Go modules and replace

2018-10-19 Thread Mark Volkmann
I see though that "go mode edit" really wants there to be a dot in the first part of the import path. Where can I read about that requirement? On Fri, Oct 19, 2018 at 6:30 PM Mark Volkmann wrote: > Thank you so much! I actually got it to work without having a dot in the > f

Re: [go-nuts] [ANN] Koazee a library inspired by functional programming and lazy evaluation that takes the hassle out of working with arrays

2018-11-11 Thread Mark Volkmann
Wow, this is a wonderful library! Thanks so much for creating this! --- R. Mark Volkmann Object Computing, Inc. > On Nov 11, 2018, at 1:27 PM, Iván Corrales Solera > wrote: > > Hey guys, last weeks I've been working on Koazee and I just released a very > first

Re: [go-nuts] [ANN] Koazee a library inspired by functional programming and lazy evaluation that takes the hassle out of working with arrays

2018-11-13 Thread Mark Volkmann
ved 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.

Re: [go-nuts] go language sensitive editor?

2018-11-20 Thread Mark Volkmann
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. > -- R. Mark Volkma

[go-nuts] pointer dereference optimization in loops

2018-11-30 Thread Mark Volkmann
this? myValue := *myPtr for _, v := range values { fmt.Printf("%v %v\n", myValue, v) } -- R. Mark Volkmann Object Computing, Inc. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rece

Re: [go-nuts] pointer dereference optimization in loops

2018-11-30 Thread Mark Volkmann
each loop iteration? On Fri, Nov 30, 2018 at 11:36 AM Jan Mercl <0xj...@gmail.com> wrote: > > On Fri, Nov 30, 2018 at 6:16 PM Mark Volkmann > wrote: > > > Will the Go compiler optimize the pointer dereference so it doesn't > happen in every loop iteration? If

[go-nuts] getting a reflect.Type for a type

2018-12-05 Thread Mark Volkmann
this: myThingType := reflect.TypeOf(new(MyThing)).Elem() I seems odd that I have to create one with new, getting a pointer to it, and then ask for the type of the thing in points to (with Elem) in order to get what I need. -- R. Mark Volkmann Object Computing, Inc. -- You received this message

[go-nuts] pass interface

2018-12-09 Thread Mark Volkmann
Is it possible to pass an interface to a function in Go? I don’t want to pass a value whose type implements the interface, I want to pass the interface. -- R. Mark Volkmann Object Computing, Inc. -- You received this message because you are subscribed to the Google Groups "golang-nuts&q

Re: [go-nuts] Re: pass interface

2018-12-10 Thread Mark Volkmann
> > > > > понедельник, 10 декабря 2018 г., 5:05:12 UTC+3 пользователь Robert Engels > написал: >> >> I mean reflect.Type not a type that is an interface. >> >> On Dec 9, 2018, at 6:53 PM, Space A. wrote: >> >> Of course. When you "pass a

Re: [go-nuts] Re: pass interface

2018-12-10 Thread Mark Volkmann
> } > > > > > > fmt.Println("reflect.Type is", reflect.TypeOf(&i).Elem()) > > > } > > > > > > Output: > > > > > > is interface, with value: test > > > reflect.Type is interface {} >

Re: [go-nuts] Re: pass interface

2018-12-10 Thread Mark Volkmann
Thanks so much Dan! --- R. Mark Volkmann Object Computing, Inc. > On Dec 10, 2018, at 8:34 PM, Dan Kortschak wrote: > > https://play.golang.org/p/VWPb_AcgUrl > >> On Mon, 2018-12-10 at 20:14 -0600, Mark Volkmann wrote: >> Here is some code that shows a part of what I&

Re: [go-nuts] Re: if/switch statements as expressions

2018-12-21 Thread Mark Volkmann
ld be expressions rather >> than statements. How would that negatively impact the language, in a way >> that can't already be reproduced? >> > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsu

[go-nuts] reflect Kind method

2018-12-24 Thread Mark Volkmann
the index excludes the Kind method in the list of Type methods? -- R. Mark Volkmann Object Computing, Inc. -- 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 e

Re: [go-nuts] reflect Kind method

2018-12-24 Thread Mark Volkmann
n, Dec 24, 2018 at 12:04 PM Ian Lance Taylor wrote: > On Mon, Dec 24, 2018 at 9:29 AM Mark Volkmann > wrote: > > > > IIUC, Kind is a method of both Type and Value. But the index near the > top of https://golang.org/pkg/reflect/ only shows it as a method of > Value. If yo

Re: [go-nuts] reflect Kind method

2018-12-24 Thread Mark Volkmann
Maybe it would be good to add an indication of just the basic type of each type in the index. For example, is the type a struct, interface, or something else? --- R. Mark Volkmann Object Computing, Inc. > On Dec 24, 2018, at 12:35 PM, Ian Lance Taylor wrote: > > On Mon, Dec 24, 2018

Re: [go-nuts] When to use panic?

2019-01-03 Thread Mark Volkmann
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/

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-24 Thread Mark Volkmann
> On Apr 24, 2019, at 6:22 AM, Robert Engels wrote: > > Though to the ops point, not sure why Go doesn’t have the ternary operator - > which is pretty ubiquitous. The idea of adding the ternary operator to Go has been debated many times. It’s clear that those in charge have a strong dislike

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-24 Thread Mark Volkmann
ted ternaries. R. Mark Volkmann Object Computing, Inc. > On Apr 24, 2019, at 8:58 AM, Jan Mercl <0xj...@gmail.com> wrote: > >> On Wed, Apr 24, 2019 at 3:48 PM L Godioleskky wrote: >> >> The lack of a Go ternary operator is at odds with Go's major theme of clean

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-24 Thread Mark Volkmann
t; > >>> > 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+uns

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-24 Thread Mark Volkmann
f4a455e71b5f9fff79310/src/lib/libz/deflate.c#L597-L609 > > For those who don't want to follow those links this is the code from the > first URL above: > > lc_unicodeliterals = quote=='u' ? 1 : quote=='U' ? 0 : !!(ast.locale.set & > AST_LC_unicodeliterals

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-25 Thread Mark Volkmann
ly be confused by operators related to channels. If you allow people to use pointers, will they use pointers to pointers to pointers to pointers? On Thu, Apr 25, 2019 at 9:19 AM Sam Whited wrote: > On Wed, Apr 24, 2019, at 14:08, Mark Volkmann wrote: > > Are there really developers that