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 standard library are developed.  Of
> > course, there's no reason for them to.  Go is doing fine, so why
> > should they interfere?  And what could they gain if they did
> > interfere?  So they leave us alone.
>
> I wanted to further comment on this particular point, since I keep
> seeing it brought up and have had it mentioned to me several times OOB
> in the context of "why would you care if the Go team can push through
> proposals and immediately merge implementations with limited community
> input or without the opportunity for alternatives,?Google execs aren't
> making these decisions, the Go team is!"
>
> I believe you when you say that upper management has never interfered
> with the direction of Go, but the point is that they could in the
> future. Not having a community check on the Go core team means there is
> no community check on the future Go core team, or higher up execs that
> decide they want a finger in the pie. We don't know who will be in
> charge of the Go team in 10 or 20 years, and they may be less principled
> than the current team. We also don't know how Google will have changed,
> or what kinds of pressures might be put on the Go team from a future over-
> zealous Google executive who wants a hand in the proposal process pie.

The ultimate community check is to power to fork the project.  I've
personally been involved in a successful fork of a significant free
software project (search for EGCS in
https://en.wikipedia.org/wiki/GNU_Compiler_Collection) so I know that
it is possible.

Of course that's not necessarily helpful in practice.  I actually
agree with earlier comments by Matt Farina that Go is currently open
source but not open governance.  What I'm not sure about is how much
it matters.

Also, the open source release of Go was (slightly) less than 10 years
ago.  Languages like C and C++ did not have any sort of governance
model at this stage of their development.  I don't know what the Go
ecosystem will look like in 10 years, but I know it will be different
than it is today.

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/CAOyqgcUofZ2_WLaR6T8XhD3pAzyqcou6CQvs-aswVda5XtHqHQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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: golang-nuts
Subject: [go-nuts] Test a Golang API on the web

Hi,

My teacher has asked me to develop an API with Golang and test it on the web 
instead of localhost. I was thinking of github.io but then I figured out, it 
doesn't support server-side languages and just support static pages. Would you 
please let me know, if there is any platform which I can test my API online 
rather than localhost? (for free, of course)
It is worth to mention my API generally generates just a couple of strings from 
a JSON file, thus it does not need a database.

thanks,
Aimar

--
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/5202a914-c3bc-48d4-bdb0-e613a83ea24d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
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/MN2PR03MB4797FD6DD3C23C88F6CB2F8EB31F0%40MN2PR03MB4797.namprd03.prod.outlook.com.
For more options, visit https://groups.google.com/d/optout.


[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),
bufio.NewWriter(os.Stdout))
fmt.Print(">>> ")

cmd, _ = console.ReadString('\n')
switch cmd {
...
...

Now my thinking is that I should be able to simply assign "cmd" from 
anywhere outside the loop
followed by a newline character (i e "cmd = "Test \n") and the reader 
should pick it up as if it was a manual input.

Unfortunately, that doesn't quite seem to work yet.

On Wednesday, 29 May 2019 19:26:58 UTC+2, 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() {
> switch reader.Text() {
> ...
> ...
>
> This is quite convenient. However, I now want to be able to pass in text 
> from outside this for-loop. Say I have a function "Invoke(arg string)" 
> which I should be able to call to pass
> arguments straight to the Scanner interface.
>
> What would be the most straightforward way to achieve this?
>

-- 
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/1ad89796-0624-47ad-9fdf-ad6c4786c025%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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() {
> switch reader.Text() {
> ...
> ...
>
> This is quite convenient. However, I now want to be able to pass in text
> from outside this for-loop. Say I have a function "Invoke(arg string)"
> which I should be able to call to pass
> arguments straight to the Scanner interface.
>
> What would be the most straightforward way to achieve this?
>

https://golang.org/pkg/strings/#NewReader should do what you require.


> --
> 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/b34d4bea-d819-4832-9ebd-db11709d6b0c%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAJhgacjbQR6k9c0Js%2Bqi8iY4CLHY07LP3To4p62ukv1VmXyEoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[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 want to be able to pass in text 
from outside this for-loop. Say I have a function "Invoke(arg string)" 
which I should be able to call to pass
arguments straight to the Scanner interface.

What would be the most straightforward way to achieve this?

-- 
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/b34d4bea-d819-4832-9ebd-db11709d6b0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 managing other 
software 
*Mark Drawing Code* (3) DESIGN PLUS WORDS, LETTERS, AND/OR NUMBERS 
*Design Search Code* 26.17.01 - Bands, straight ; Bars, straight ; Lines, 
straight ; Straight line(s), band(s) or bar(s)
26.17.06 - Bands, diagonal ; Bars, diagonal ; Diagonal line(s), band(s) or 
bar(s) ; Lines, diagonal 
*Serial Number* 88100957 
*Filing Date* August 31, 2018 
*Current Basis* 1B 
*Original Filing Basis* 1B 
*Owner* (APPLICANT) Google LLC LIMITED LIABILITY COMPANY DELAWARE 1600 
Amphitheatre Parkway Mountain View CALIFORNIA 94043 
*Description of Mark* Color is not claimed as a feature of the mark. The 
mark consists of the stylized word GO with three small lines to the left of 
the word. 
*Type of Mark* TRADEMARK 
*Register* PRINCIPAL 
*Live/Dead Indicator* LIVE


[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 managing other 
software. FIRST USE: 20091110. FIRST USE IN COMMERCE: 20091110 
*Standard Characters Claimed* 
*Mark Drawing Code* (4) STANDARD CHARACTER MARK 
*Serial Number* 88100955 
*Filing Date* August 31, 2018 
*Current Basis* 1A 
*Original Filing Basis* 1A 
*Owner* (APPLICANT) Google LLC LIMITED LIABILITY COMPANY DELAWARE 1600 
Amphitheatre Parkway Mountain View CALIFORNIA 94043 
*Type of Mark* TRADEMARK 
*Register* PRINCIPAL 
*Live/Dead Indicator* LIVE

I wasn't able to check "golang" because the USPTO web site's search 
facility had a meltdown.



d

On Friday, May 24, 2019 at 10:51:05 AM UTC+10, Gerald wrote:
>
> On Fri, 24 May 2019 07:40:52 +1000, you wrote: 
>
> >The last sentence of the article is not correct. The name Go is not 
> >trademarked by Google, at least as a programming language trademark. 
> There 
> >are other things Google makes called Go (an interesting signal on its 
> own) 
> >and they might be trademarked, but Go the language is not a trademark. 
>
> The link provided in the blog post would seem to indicate otherwise. 
>
> If one scrolls down the list the following 2 entries are of interest: 
>
> Golang™ programming language 
> Go™ programming language 
>
> https://www.google.com/permissions/trademark/trademark-list/ 
>
>

-- 
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/8cffbb9b-be49-4ae9-8d11-d91d409d42da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 them to.  Go is doing fine, so why
> should they interfere?  And what could they gain if they did
> interfere?  So they leave us alone.

I wanted to further comment on this particular point, since I keep
seeing it brought up and have had it mentioned to me several times OOB
in the context of "why would you care if the Go team can push through
proposals and immediately merge implementations with limited community
input or without the opportunity for alternatives,?Google execs aren't
making these decisions, the Go team is!"

I believe you when you say that upper management has never interfered
with the direction of Go, but the point is that they could in the
future. Not having a community check on the Go core team means there is
no community check on the future Go core team, or higher up execs that
decide they want a finger in the pie. We don't know who will be in
charge of the Go team in 10 or 20 years, and they may be less principled
than the current team. We also don't know how Google will have changed,
or what kinds of pressures might be put on the Go team from a future over-
zealous Google executive who wants a hand in the proposal process pie.

—Sam

-- 
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/1358d19f-b7a6-46db-b970-35c0f7c640d7%40www.fastmail.com.
For more options, visit https://groups.google.com/d/optout.


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 do that here (hint, know your ASCII characters):

https://golang.org/pkg/fmt/

On Wed, May 29, 2019 at 8:44 AM Tong Sun  wrote:

> 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?
>
>
> --
> 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/e3ea401d-d40a-4535-8d8c-bec9c539a1c9%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Philip A. Chapman
Java Software Development
Enterprise, Web, and Desktop

-- 
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/CABEejsjcycM0j4%2Bfj91M_LNKR89kYQsOGJHhPjy3Ymzz7CrG4g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[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 and who etc. determines future directions of 
the language, the only real alternative a user has is to accept Go 'as is' 
or move on to something else ..If you choose to stay with Go, you have to 
accept it for what it is , not what you'd like it to be.

If you decide to stay with Go, this doesn't mean you have to stop 
advocating /supporting  changes to the language and/or changes to how the 
language is governed. 
As an aside, I'm one of the 'golang-nuts' who support adding a modernized 
version of the C ternary operator to Go, but many of my other golang-nuts 
think I'm 'nuts'  I also vote 'no' regarding generics.

If a Go user decides to move on to something else,  you'll still end up 
with governance issues ..
At one extreme you can move on to Python  which is governed by the  BDFL 
Guido van Rossum philosophy. 
Did van R do great things for Python ?  ...Let me answer this by saying  
that with I never got past the nightmare I experienced trying to install 
PIP, NumPy and SciPy packages on my Windows box.

At the other extreme you can move on to to something like C++ with a system 
of governance that can only be described as "Wild West"

For me the Governance issue is very much secondary to my more major issue 
which is the availability of packages I need to support the apps I want to 
develop.

For me, this is where Go ranks way above the other languages I've tried 
over my many years as a developer.
When I first moved over to Go the first package I wanted to get up and 
running was the Go "image" package.
It took me less that an hour to port one of my major C++ libPNG based image 
processing apps over to Go. 
This was enough to make me a Go believer considering the many months I 
wasted developing PNG image processing apps  using C++ and libPNG.

I could go on and on regarding similar experiences I've had with other Go 
packages, but my point is that, for me, 
Go's system of package management and its spectrum of available Go packages 
is what makes Go superior to other languages.

I'm am old timer with lots of C++ apps that I developed over the years 
before I switched over to Go.
I've ported many of these apps to Go, except for those that require too 
much time for me to convert, or those that require packages that are not 
available in Go.  So for now I have to live with both Go and C++.

Go governance is important but,  for me it is much less important than 
package availability and the ability to get packages up and running quickly.

So my my major issue is involves adding more packages to Go,  especially 
math-sci-engineering oriented packages so I can avoid having to switch over 
to Julia (or worse yet FORTRAN) when I need to develop these kind of apps.  
 
Yea, I've tried packages available on https://godoc.org/gonum.org/v1/gonum  
but I find many of these Go packages are primitive compared to those 
available in C++ (and in some cases even FORTAN)

Any way, that's my "two pennies" worth


On Thursday, May 23, 2019 at 9:18:25 AM UTC-4, L Godioleskky wrote:
>
> https://utcc.utoronto.ca/~cks/space/blog/programming/GoIsGooglesLanguage
>

-- 
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/71cdb184-5d19-4ec7-bac8-c5131f3361f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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? 


-- 
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/e3ea401d-d40a-4535-8d8c-bec9c539a1c9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 out* - then do your L.DoFile.

While it may not seem much of a change, it means that as soon as your 
program runs, whatever scripts it needs get punted out onto the file system 
where your end user can see and fiddle with them.

Depending on your intentions, your way may be more appropriate (e.g. you 
only want the dynamicism to support updates rather than end-user 
tinkering), but this method is more discoverable if end-user tweaking is 
permissible.

-- 
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/58faabde-82a0-43da-b88d-cda4a94bdb36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 := 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' and can modify it 
> (the reflect.Value 'r' is settable).
> In turn, this also allows to declare 'Config' as follows:
> ```
> type Config struct {
> Name String
> }
> ```
> i.e. removes the need to use a *pointer* to String.
> You also need some minor adjustments to the rest of the code...
>
> A complete example is:
>
> https://play.golang.org/p/AxPE0K_ivxP
>
> On Wednesday, May 29, 2019 at 11:56:42 AM UTC+2, Sotirios Mantziaris wrote:
>>
>> 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 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 UTC+3, Jan Mercl wrote:

 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 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/f121de4b-95a3-4a9b-9084-7672a8e20d34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 'Commander' Pike wrote:
>> If that's true - and it might well not be - it's a surprise to me. When 
>> launching the language we explicitly made sure NOT to trademark it.
>> 
>> -rob
>> 
>> 
>>> On Fri, May 24, 2019 at 10:50 AM Gerald Henriksen  wrote:
>>> On Fri, 24 May 2019 07:40:52 +1000, you wrote:
>>> 
>>> >The last sentence of the article is not correct. The name Go is not
>>> >trademarked by Google, at least as a programming language trademark. There
>>> >are other things Google makes called Go (an interesting signal on its own)
>>> >and they might be trademarked, but Go the language is not a trademark.
>>> 
>>> The link provided in the blog post would seem to indicate otherwise.
>>> 
>>> If one scrolls down the list the following 2 entries are of interest:
>>> 
>>> Golang™ programming language
>>> Go™ programming language
>>> 
>>> https://www.google.com/permissions/trademark/trademark-list/
>>> 
> 
> -- 
> 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/152bc446-1839-4da8-a9ac-1cab12dcbbff%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/FFFE42CB-27C5-44AD-A99C-64EB62D0D674%40ix.netcom.com.
For more options, visit https://groups.google.com/d/optout.


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 'Commander' Pike wrote:
>
> If that's true - and it might well not be - it's a surprise to me. When 
> launching the language we explicitly made sure NOT to trademark it.
>
> -rob
>
>
> On Fri, May 24, 2019 at 10:50 AM Gerald Henriksen  > wrote:
>
>> On Fri, 24 May 2019 07:40:52 +1000, you wrote:
>>
>> >The last sentence of the article is not correct. The name Go is not
>> >trademarked by Google, at least as a programming language trademark. 
>> There
>> >are other things Google makes called Go (an interesting signal on its 
>> own)
>> >and they might be trademarked, but Go the language is not a trademark.
>>
>> The link provided in the blog post would seem to indicate otherwise.
>>
>> If one scrolls down the list the following 2 entries are of interest:
>>
>> Golang™ programming language
>> Go™ programming language
>>
>> https://www.google.com/permissions/trademark/trademark-list/
>>
>>

-- 
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/152bc446-1839-4da8-a9ac-1cab12dcbbff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 implemented in C++, but it requires careful discipline 
throughout the implementation. It is essentially impossible to do in a 
target language whose variables are recycled by the garbage collector of 
the host language. Turing incompleteness of the target language (bounded 
recursion only) seems like it ought to help but in fact does not; a bounded 
program can still use all your memory and take ~forever.

The only reliable way to impose bounds is to use the operating system. Put 
the untrusted code in a different process, impose a limit on its maximum 
memory size, and kill it if it hasn't finished by your deadline.
 

-- 
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/b4182f6d-8a3c-41a2-9cb0-e9d3c7fb1780%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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' and can modify it 
(the reflect.Value 'r' is settable).
In turn, this also allows to declare 'Config' as follows:
```
type Config struct {
Name String
}
```
i.e. removes the need to use a *pointer* to String.
You also need some minor adjustments to the rest of the code...

A complete example is:

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

On Wednesday, May 29, 2019 at 11:56:42 AM UTC+2, Sotirios Mantziaris wrote:
>
> 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 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 UTC+3, Jan Mercl wrote:
>>>
>>> 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 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/b7ac54f5-515c-448d-84db-f58ee7e80697%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 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 UTC+3, Jan Mercl wrote:
>>
>> 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 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/e2eb5584-242c-4144-ad32-a42583ee8cfe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 UTC+3, Jan Mercl wrote:
>
> 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 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/001a34f6-163e-45fa-84ce-b10214b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[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 
generics (C++ style generics are complete; a second alternative 
implementation more closely following Go generics proposals is in progress).

I think there may be others I don't know about.

On Wednesday, May 29, 2019 at 4:12:27 AM UTC+2, Slawomir Pryczek wrote:
>
> Come on, open your minds a little. Once every 5 years it doesn't hurt to 
> learn some new, better ways of doing things. And if someone wants to write 
> java code untill he dies, then there's a great method of doing that called 
> "stick to java" ;)
>
> That same kind of thinking already marginalized nodejs. The code written 
> in it is horrible because almost everyone is trying to emulate c++ and java 
> instead of taking one week to learn the language a bit and JS is so 
> flexible you can actually do that to some extent. Not sure why some people 
> think that every language on the planet needs to be a bad clone of c++ or 
> java probably putting "java" in its name doesn't help. Thanks GOD it's 
> golang, not go++, we'd be doomed.
>
> Seriously. For me - against generics because of amount of complexity and 
> issues it'd introduce into the language. Would be cool to see a fork 
> implementing it because maybe it can be done "nicely", however i doubt 
> it... It brings to mind Rust's multithreading paradigms. That's actually 
> great stuff...  but totally unfit for integrating with golang (for this im 
> preety sure). Hopefully, if generics will be implemented it won't be 
> integrated too tightly so i won't have to get back to writing code which is 
> more jav'ish that it needs to be. Because, that's a crazy idea... if i 
> liked how java works more i'd just use java ;) And introducing operator 
> overloading into this beautiful design will be like putting readability 
> back into medieval ages...
>

-- 
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/d4a9f7d7-d54c-40fb-b798-aab95d113859%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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 methods to call.
> > What am i doing wrong (besides using reflection :))?
>
> The method has a pointer receiver: https://play.golang.org/p/qjhqSvhE9PL
>


-- 
Regards,

S. Mantziaris

-- 
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/CAEGsCe2AfWreDBbs4OJy8xSxi0Xs-ibxw%3DB4X%2BRwSJpwx60TNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


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 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/CAA40n-XhXgHagW5wDg%3DuFi2mc6Q%3DoKUrCX01wOFx6aEo2e0O7Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[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 (besides using reflection :))?

Check out the playground link?
https://play.golang.org/p/XSRG5rFWdhq

-- 
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/83c973f9-429d-4b8b-a7a6-31fd048b9c7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.