Re: [go-nuts] Interesting public commentary on Go...

2019-05-29 Thread Ian Lance Taylor
On Wed, May 29, 2019 at 12:11 PM Sam Whited wrote: > > On Thu, May 23, 2019, at 17:59, Ian Lance Taylor wrote: > > But (and here you'll just have to trust me) those executives, and > > upper management in general, have never made any attempt to affect how > > the Go language and tools and

RE: [go-nuts] Test a Golang API on the web

2019-05-29 Thread Michael Banzon
You could look at Heroku. It should be pretty easy to get started with. You could also find a coupon code for Digital Ocean and fire up a server on your own. / M From: golang-nuts@googlegroups.com on behalf of aimar Sent: Monday, May 27, 2019 9:28:21 AM To:

[go-nuts] Re: Write to bufio Scanner from outside os.Stdin

2019-05-29 Thread Mark Bauermeister
Thanks! I've changed the code to this: var console *bufio.ReadWriter var cmd string func (g *Game) Parse() { // reader should be wrapped inside an _input() function. for { console = bufio.NewReadWriter( bufio.NewReader(os.Stdin),

Re: [go-nuts] Write to bufio Scanner from outside os.Stdin

2019-05-29 Thread roger peppe
On Wed, 29 May 2019 at 18:27, Mark Bauermeister wrote: > I'm in the process of writing a text adventure parser. > By default, the parser simply uses Stdin. > > i e > > for { > fmt.Print(">>> ") > > reader := bufio.NewScanner(os.Stdin) > for reader.Scan() { >

[go-nuts] Write to bufio Scanner from outside os.Stdin

2019-05-29 Thread Mark Bauermeister
I'm in the process of writing a text adventure parser. By default, the parser simply uses Stdin. i e for { fmt.Print(">>> ") reader := bufio.NewScanner(os.Stdin) for reader.Scan() { switch reader.Text() { ... ... This is quite convenient. However, I now

Re: [go-nuts] Re: Interesting public commentary on Go...

2019-05-29 Thread da4089
A quick search of the USPTO trademarks database reveals: [image: Mark Image] *Word Mark * GO *Goods and Services* IC 009. US 021 023 026 036 038. G & S: Computer programs and downloadable computer programs that implement a computer programming language for use in developing, building and

Re: [go-nuts] Interesting public commentary on Go...

2019-05-29 Thread Sam Whited
On Thu, May 23, 2019, at 17:59, Ian Lance Taylor wrote: > But (and here you'll just have to trust me) those executives, and > upper management in general, have never made any attempt to affect how > the Go language and tools and standard library are developed. Of > course, there's no reason for

Re: [go-nuts] Http header and CR LF

2019-05-29 Thread Philip Chapman
This is not a golang question per-se, but a question about HTTP headers. My suggestion is to read up on HTTP headers and their requirements here: https://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html And concerning inserting an actual carriage return followed by a line feed, you can see how to

[go-nuts] Re: Interesting public commentary on Go...

2019-05-29 Thread lgodio2
My thanks to all ... This thread has provided me a wealth of interesting and varied ideas regarding Go user community viewpoints on Go governance. For what its worth here's my 'two cents' worth ... In the end, every Go user has only one 'Go' he/she can choose to useRegardless of how, why

[go-nuts] Http header and CR LF

2019-05-29 Thread Tong Sun
A question related to Go as "\n" in Go does not mean CR LF -- Is http header requires CR LF as line end? Perl can handle "\n" automatically for CR LF, but I saw a Perl program ends each http header specifically with CR LF. Shall I care about doing the same thing for my Go http handling?

[go-nuts] Re: Any alternative to go-bindata that supports dynamic assets?

2019-05-29 Thread howardcshaw
Just a suggestion, Mark - instead of L.DoString(string(file)) in response to a failure on L.DoFile (is there no other error that can occur there other than the file being missing?), do an explicit test for the file existing, and if it does not exist, grab the asset from bindata and *write it

Re: [go-nuts] reflect Call method on nested struct

2019-05-29 Thread Sotirios Mantziaris
Hi Max, this makes the config even simpler since i do not need to be sure that the field is nil. I will try this out for sure. On Wednesday, May 29, 2019 at 1:56:14 PM UTC+3, Max wrote: > > There is another improvement you can do: you are currently using > > cfg := Config{Name: } > r :=

Re: [go-nuts] Re: Interesting public commentary on Go...

2019-05-29 Thread Robert Engels
Watch out, you must not mention java here - at a minimum spell it with lowercase so you can pretend you were talking about coffee :) > On May 29, 2019, at 6:55 AM, JuciÊ Andrade wrote: > > Registering Go as a trademark is important to protect it against improper use. > Let's not forget "Sun

Re: [go-nuts] Re: Interesting public commentary on Go...

2019-05-29 Thread JuciÊ Andrade
Registering Go as a trademark is important to protect it against improper use. Let's not forget "Sun vs Microsoft" fighting to define what could be named "Java". https://www.zdnet.com/article/sun-vs-microsoft-clash-of-the-titans-5000121284/ On Friday, May 24, 2019 at 3:49:18 AM UTC-3, Rob

[go-nuts] Re: Adding a timeout to a script interpreter (without leaking a goroutine)

2019-05-29 Thread adonovan via golang-nuts
On Tuesday, 21 May 2019 01:18:34 UTC-4, Ben Hoyt wrote: > > I'm looking at adding a timeout option to my GoAWK script interpreter... > Are there better / more performant ways to handle this? > Hi Ben, imposing resource bounds is a tricky problem. It's possible to do it in an interpreter

Re: [go-nuts] reflect Call method on nested struct

2019-05-29 Thread Max
There is another improvement you can do: you are currently using cfg := Config{Name: } r := reflect.ValueOf(cfg) which means that 'r' will contain a copy of 'cfg' and will not be settable. If instead you use: r := reflect.ValueOf().Elem() then r will contain a *pointer* to the original 'cfg'

Re: [go-nuts] reflect Call method on nested struct

2019-05-29 Thread Sotirios Mantziaris
Ok, found it. I should have used the reflect.ValueOf... On Wednesday, May 29, 2019 at 12:53:13 PM UTC+3, Sotirios Mantziaris wrote: > > I did found out that the setter method has to accept a pointer to string. > I have a complete example now which unfortunately don't work correclty. > The value

Re: [go-nuts] reflect Call method on nested struct

2019-05-29 Thread Sotirios Mantziaris
I did found out that the setter method has to accept a pointer to string. I have a complete example now which unfortunately don't work correclty. The value should change but it is emptied out. https://play.golang.org/p/OPZKltApEhF What am i missing? On Wednesday, May 29, 2019 at 10:46:32 AM

[go-nuts] Re: Interesting public commentary on Go...

2019-05-29 Thread Max
Although it's slightly off-topic, there are already some Go forks or variants that implement generics. One is Fo https://github.com/albrow/fo - a source-to-source transpiler that converts "Go with generics" to plain Go Another is my https://github.com/cosmos72/gomacro - a Go interpreter with

Re: [go-nuts] reflect Call method on nested struct

2019-05-29 Thread Sotirios Mantziaris
you are a live saver. thanks very much. reflection is of of these things in any language i suppose. On Wed, 29 May 2019 at 10:46, Jan Mercl <0xj...@gmail.com> wrote: > On Wed, May 29, 2019 at 9:42 AM Sotirios Mantziaris > wrote: > > > I am getting the nested "Name" struct but there are no

Re: [go-nuts] reflect Call method on nested struct

2019-05-29 Thread Jan Mercl
On Wed, May 29, 2019 at 9:42 AM Sotirios Mantziaris wrote: > I am getting the nested "Name" struct but there are no methods to call. > What am i doing wrong (besides using reflection :))? The method has a pointer receiver: https://play.golang.org/p/qjhqSvhE9PL -- You received this message

[go-nuts] reflect Call method on nested struct

2019-05-29 Thread Sotirios Mantziaris
Hi, i have a nested struct and i want to call a method on a field. type String struct { value string } func (s *String) Set(value string) { s.value = value } type Config struct { Name String } I am getting the nested "Name" struct but there are no methods to call. What am i doing wrong