Re: [go-nuts] Inconsistency in the casting int to byte

2018-11-18 Thread Gregory Graham
Thank for expanding on that. As a Go newbie, I didn't see how Jan's response answered your question, but you made it clear. On Sunday, November 18, 2018 at 4:34:00 PM UTC-6, gith...@gmail.com wrote: > > Thank you Jan, > I read the spec a bit more carefully after you pointed it out and I now > un

[go-nuts] Re: compiling from within vim not working

2018-11-18 Thread Jay Ts
On Saturday, November 17, 2018 at 11:16:08 AM UTC-7, rob wrote: > > Hi. I'm interested in trying the internal compiling option for Go. > > Vim 7.4. Ubuntu 16.04 amd64 > > go 1.11.2 > > I'm using the version of vim that gets installed by apt. > > When I type :make from a window showing a buf

Re: [go-nuts] Inconsistency in the casting int to byte

2018-11-18 Thread github . 7i
Thank you Jan, I read the spec a bit more carefully after you pointed it out and I now understand that a constant and a non-constant value are treated differently and that my examples above is an example of just this. "A constant value x can be converted to type T if x is representable by a val

Re: [go-nuts] protoc question

2018-11-18 Thread Tharaneedharan Vilwanathan
Hi Josh, Got it! I had it all working but I was a bit confused when I noticed only Go related help text was missing in help text. Thanks for the quick response and clarification! Regards dharani On Sun, Nov 18, 2018 at 2:06 PM Josh Humphries wrote: > Support for Go is not built into protoc. In

[go-nuts] goyang question

2018-11-18 Thread Tharaneedharan Vilwanathan
Hi All, I have a quick question. I have a .yang file with this definition: leaf DummyEnumExample { mandatory false; type enumeration { enum zero; enum one { value 1; } enum seven { value 7; } } } I run the command: $ goyang --format proto ../yang/entry.yang > entry.proto It generates

Re: [go-nuts] protoc question

2018-11-18 Thread Josh Humphries
Support for Go is not built into protoc. Instead, Go code gen relies on a protoc plugin. A serious omission from the help output for protoc is how to use plugins: --_out Generate source code by invoking plugin program named protoc-gen-. So, to use the --go_out flag, you need to install the Go pl

[go-nuts] protoc question

2018-11-18 Thread Tharaneedharan Vilwanathan
Hi All, I have a minor question. When I run "protoc --help", I do not see "go_out" option but I see others: --cpp_out=OUT_DIR Generate C++ header and source. --csharp_out=OUT_DIRGenerate C# source file. --java_out=OUT_DIR Generate Java source file. --js_out=OUT_

Re: [go-nuts] Inconsistency in the casting int to byte

2018-11-18 Thread Michael Jones
It feels awkward...I’ve always felt the limit should be removed after the innermost cast because that’s when the programmer has said “treat this as type A” and then says “treat an A as a B with every implication that a narrowing conversion causes.” On Sun, Nov 18, 2018 at 9:55 AM Jan Mercl <0xj...

Re: [go-nuts] Inconsistency in the casting int to byte

2018-11-18 Thread Jan Mercl
On Sun, Nov 18, 2018 at 6:42 PM wrote: It's consistent with the language specification ;-) A constant value x can be converted to type T if x is representable by a value of T. https://golang.org/ref/spec#Conversions -- -j -- You received this message because you are subscribed to the Goog

[go-nuts] Inconsistency in the casting int to byte

2018-11-18 Thread github . 7i
Hi! I noticed a strange behavior and wanted to see if this is intended behavior and why this behavior is present or if this is a bug. // Compiles without error x := int(-65) fmt.Println(byte(x)) // Gives the compile time error: "constant -65 overflows byte" fmt.Println(by

Re: [go-nuts] GoAWK: an AWK interpreter written in Go

2018-11-18 Thread Ben Hoyt
Thank you. I knew Weinberger was at Google, but didn't know he was on the Go team -- cool! On Sat, Nov 17, 2018 at 6:03 PM Alan Donovan wrote: > This is great, both as an "étude"---a challenge for sharpening your > technique---and as an exemplary write-up of the process of building > something n

[go-nuts] modules (Go 1.11) and plugins

2018-11-18 Thread Basile Starynkevitch
Hello All, https://groups.google.com/forum/#!topic/golang-nuts/swTLZyP5QK8 is a related but ancient thread. *How should Go modules be used as plugins? *My intuitive feeling is that modules are a *dramatic* feature very useful for plugins. But I don'