[go-nuts] Should I return a value or pointer?

2016-12-10 Thread Jon
I would like to know what my default practice should be when returning structs from functions. Should I return a value or a pointer? (Assume I don't need the functionality of returning a pointer and my struct contains at most one simple field so a vast copy isn't needed if I return a value.) A

[go-nuts] Re: Should I return a value or pointer?

2016-12-13 Thread Jon
l.com wrote: > > The first question you need to ask yourself is are you going to use errors > as values ( if err == myerrors.ErrValue ) or errors as types ( if e,ok:= > err.(*myerrors.ErrType ; ok ) > > Le samedi 10 décembre 2016 20:10:26 UTC+1, Jon a écrit : >> >> I

Re: [go-nuts] Should I return a value or pointer?

2016-12-13 Thread Jon
he errors package. I want to know what the thought process was behind returning a &errorString{} from errors.New instead of errorString{} or even 'type errorString string'. On Saturday, 10 December 2016 22:13:16 UTC, Axel Wagner wrote: > > > > On Sat, Dec 10, 2016 at 8:10 P

Re: [go-nuts] Should I return a value or pointer?

2016-12-13 Thread Jon
l Wagner wrote: > > On Tue, Dec 13, 2016 at 10:48 AM, Jon > > wrote: > >> Axel, that's an interesting thought on why errors.New() returns a >> &errorString. However, I would argue that being able to do >> errors.New("foo") == errors.New("fo

Re: [go-nuts] Resources to learn Go as a first programming language?

2018-02-15 Thread Jon Calhoun
You can also check out Caleb Doxseys free ebook - https://www.golang-book.com/books/intro -- 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...

[go-nuts] Re: Go += Package Versioning

2018-02-20 Thread Jon Calhoun
Would you be willing to create an example illustrating how a versioned package should look with major version changes? You have great examples for the minor/patch changes, but I don't see any concrete examples for a major version bump. On Tuesday, February 20, 2018 at 12:20:54 PM UTC-5, Russ Co

Re: [go-nuts] Go += Package Versioning

2018-02-23 Thread Jon Calhoun
Not ideal, but you *could* release a new major version where the "breaking" change is the import path change. Eg if you are on v3 now, make a v4 folder and the upgrade to v4 process would involve updating import paths. I wouldn't do this right away since vgo is just a prototype and could change to

[go-nuts] Calling sync.WaitGroup.Add() while a sync.WaitGroup.Wait() is waiting

2018-04-26 Thread Jon Bodner
gle-threaded, but when this code is run locally, it also completes without panics. Running it with the race flag also works properly. How do you trigger those panics in the WaitGroup codebase? Thanks, Jon -- You received this message because you are subscribed to the Google Groups "golang

Re: [go-nuts] Calling sync.WaitGroup.Add() while a sync.WaitGroup.Wait() is waiting

2018-04-27 Thread Jon Bodner
Thanks, everyone, for your answers! I think I understand what sync.WaitGroup is doing now. Jon On Friday, April 27, 2018 at 7:29:50 AM UTC-4, rog wrote: > > On 26 April 2018 at 16:29, Jon Bodner > > wrote: > > Hello, > > > > We were having a discussio

[go-nuts] Re: Generics as builtin typeclasses

2018-09-04 Thread Jon Conradt
Why: func Sum(type T numeric)(x []T) T { and not just func Sum(x []T type numeric) T { or func Sum(x []T Numeric) T { Jon On Tuesday, September 4, 2018 at 11:57:02 AM UTC-7, Matt Sherman wrote: > > Here’s a riff on generics focused on builtin typeclasses (instead of user >

[go-nuts] Re: A suggestion for the error handling proposal

2018-10-22 Thread Jon Conradt
I got a 404 when I tried to access this. Perhaps it is not public? Jon On Monday, October 22, 2018 at 10:33:38 AM UTC-4, Burak Serdar wrote: > > I read the error handling proposal recently, and although I like it in > general, I don't like the fact that it hides the actual erro

Re: [go-nuts] Re: How to end producer from the consumer side

2019-01-22 Thread Jon Betti
I'd also tend toward passing in a context to the producer rather than returning a "kill" channel. That way you get correct cancellation when you begin to string together multiple producers. I'd recommend reading https://blog.golang.org/pipelines in any case. https://play.golang.org/p/ftgqSokde1c

[go-nuts] Help wanted - ReferenceError: Go is not defined error

2019-04-06 Thread jon . killebrew
I am new to Go programming. I stumbled across a project for using WeAssembly at https://github.com/golang/go/wiki/WebAssembly and decided to give it a try. So I'm running a test website on the Google App Engine, and the website is running on Go. I created all the objects according to the doc

[go-nuts] Re: Help wanted - ReferenceError: Go is not defined error

2019-04-06 Thread jon . killebrew
Solved! Thank you so much, can't believe I missed that. On Saturday, April 6, 2019 at 2:12:45 PM UTC-5, Agniva De Sarker wrote: > > Remove the async attribute from your script tag. > > On Saturday, 6 April 2019 23:38:17 UTC+5:30, jon.ki...@gmail.com wrote: >> >> I am new to Go programming. I s

[go-nuts] CompileError: AsyncCompile: Wasm decoding failed

2019-04-06 Thread Jon Killebrew
Having issues getting WebAssembly (example at https://github.com/golang/go/wiki/WebAssembly). I am running a test website on the Google App Engine, and the website is running on Go. I created all the objects according to the documentation provided on the page. Now, I'm getting this error wh

[go-nuts] Re: CompileError: AsyncCompile: Wasm decoding failed

2019-04-07 Thread Jon Killebrew
that seemed to work. After publishing the files the "Hello world" program is being called on the page. Hope this helps someone else. On Sunday, April 7, 2019 at 1:10:13 AM UTC-5, Jon Killebrew wrote: > > Having issues getting WebAssembly (example at > https://github.com/golang/

[go-nuts] Re: Who are the https://gophers.slack.com/ admins?

2017-11-13 Thread Jon Calhoun
I believe the people over at https://golangbridge.org/ are responsible for the Slack as well, so I would contact them. On Monday, November 13, 2017 at 1:41:13 PM UTC-5, Vlad Didenko wrote: > > My phone got stolen, so I am locked out of the https://gophers.slack.com/ > 2FA. > > Slack tells to

Re: [go-nuts] Re: [urgent] need aguments to justify use of Go for a scientific application

2017-12-12 Thread Jon Conradt
Would you share the document? It likely would save time for others when they have similar tasks. Jon On Wednesday, December 6, 2017 at 4:27:04 PM UTC-8, Christophe Meessen wrote: > > Thank you all for your help. > > I assembled a sort document with the collected argum

Re: [go-nuts] Re: The "leave "if err != nil" alone?" anti-proposal

2019-07-03 Thread Jon Conradt
ge, but to change the editors (or even gofmt). Jon -- 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 d

Re: [go-nuts] About the Google logo on the new Go website

2019-07-15 Thread Jon Conradt
language, but you'd be crazy to do the other things. :) Jon -- 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.

[go-nuts] Re: Go for Data Science

2019-07-24 Thread Jon Conradt
There is also https://github.com/containous/yaegi described as: Yaegi is Another Elegant Go Interpreter. It powers executable Go scripts and plugins, in embedded interpreters or interactive shells, on top of the Go runtime.

[go-nuts] Quick question about the new Contracts Draft Proposal

2019-07-28 Thread Jon Bodner
Hello, I did a first read through the proposal and it looks very good. I had one question: when giving the example of how to implement Sorting using orderedSlice, the type parameter is declared to be comparable. Should that be contracts.Ordered? Thanks, Jon -- You received this message

[go-nuts] Re: Quick question about the new Contracts Draft Proposal

2019-07-28 Thread Jon Bodner
https://go.googlesource.com/proposal/+/master/design/go2draft-contracts.md (Updated on 7/25/2019) GopherCon 2019 Talk summary: https://about.sourcegraph.com/go/gophercon-2019-generics-in-go Jon On Sunday, July 28, 2019 at 7:55:50 PM UTC-4, Mandolyte wrote: > > I missed this. Do you

[go-nuts] Bug in go? Package net

2016-09-25 Thread Jon Strauss
This error: panic: runtime error: invalid memory address or nil pointer dereference [signal 0xb code=0x1 addr=0x20 pc=0x401487] goroutine 1 [running]: panic(0x50bfa0, 0xc82000a0c0) /usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6 main.main() /root/Whois3/rest-whois-threaded/main.go:65 +0x67

[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-24 Thread Jon Calhoun
s to it on github or wherever else) 2. Come up with a viable & trustworthy alternative and release it 3. Start pointing people to the alternative, including in the subreddit (stickied post?), but don't delete the subreddit. Just my 2 cents. - Jon -- You received this message because

[go-nuts] Re: multiple html templates

2016-11-28 Thread Jon Calhoun
What you are doing seems pretty normal. You could technically parse each HTML file into it's own template and then just use baseTemplate.Execute(...) and dataTemplate.Execute(...) in your code instead, but I really doubt what you are doing has a noticeable performance hit (if it even has

[go-nuts] Re: Json-ifying map[bson.ObjectId] is not as expected

2016-12-21 Thread Jon Calhoun
pe `json:"b,omitempty" bson:"b,omitempty"` } type CustomType struct { Name string } func main() { id := bson.NewObjectId() stats := Stats{ A: id, B: map[string]CustomType{ id.Hex(): CustomType{"jon"}, }, } bytes, err := json.Marshal(stats) if err != nil { panic(err) }

[go-nuts] Re: Do you guys use ORMs when working with SQL?

2016-12-28 Thread Jon Bodner
I've written a library called Proteus that is a simple tool for dynamically generating a data access layer: https://github.com/jonbodner/proteus You need to write the SQL queries, but it will map values (variables, slices, structs, maps) into queries and map the results into a struct or map.

Re: [go-nuts] Re: What's the best IDE for golang?

2017-01-02 Thread Jon Mayo
LiteIDE worked out of the box at one time. I've not had any problems, but with software in a constant state of development I wouldn't be surprised if something is broken. That is a price one usually pays when working with new languages and tools. - Jon On Jan 2, 2017 9:51 AM, wrote

[go-nuts] Unsure when two interfaces are considered identical

2016-07-03 Thread Jon Bodner
an't figure out that ResultA and ResultB are identical without that wrapper. Why is that? Why does the compiler fail the first case and pass the second one? Thanks, Jon -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

Re: [go-nuts] Unsure when two interfaces are considered identical

2016-07-04 Thread Jon Bodner
. I think this is a pretty common pattern in Go, writing code that consumes interfaces defined within the same project, even if the methods are identical to those on an interface in a third-party package. What would I need to do to get more consideration for including #16209 in Go 1.8? Thanks,

Re: [go-nuts] Unsure when two interfaces are considered identical

2016-07-04 Thread Jon Bodner
that addressed this. I'm hoping that it can make it into Go 1.8 and I'm interested in finding out what I can do to help that happen. Jon On Monday, July 4, 2016 at 10:54:03 AM UTC-4, Constantin Konstantinidis wrote: > > It seems to me that the compiling error is adequat

Re: [go-nuts] Unsure when two interfaces are considered identical

2016-07-04 Thread Jon Bodner
omatically converting anything involving a concrete type makes sense to me. But not automatically recognizing that two interfaces that implement the same methods are the same in some situations but not in others strikes me as a surprising limitation on implicit interfaces. Thanks, Jon On Mond

[go-nuts] Channels not working

2016-08-05 Thread Jon Strauss
Hello, I have the following code: package main import "fmt" import "encoding/hex" import "os" func main() { var bytes []byte var channel chan []byte file,_ := os.OpenFile("/dev/random", os.O_RDONLY, 0) bytes = make([]byte,20) _, _ = file.Read(bytes) ch

[go-nuts] Re: Channels not working

2016-08-05 Thread Jon Strauss
nel. Once the main > goroutine returns, the program will exit. > > On Saturday, 6 August 2016 08:38:54 UTC+10, Jon Strauss wrote: >> >> Hello, >> I have the following code: >> >> package main >> >> import "fmt" >> import

Re: [go-nuts] Re: text/template: cannot index from map[int32]string

2017-05-20 Thread Jon Calhoun
As a temporary fix you could create a custom function for when you are using maps with an int32 key. This is less than ideal but would work temporarily - https://play.golang.org/p/IOa_p4gxDB On Saturday, May 20, 2017 at 12:26:46 PM UTC-4, bup...@gmail.com wrote: > > I reported this as issue #204

[go-nuts] Newbie How to read unmarshall a varient struct in Json

2017-06-04 Thread Jon Calhoun
See the last section of this article where it talks about generics - https://blog.gopheracademy.com/advent-2016/advanced-encoding-decoding/ It isn't exactly what you are doing but the same idea should work in your use case. The encoding/decoding code becomes longer but it makes using the data s

[go-nuts] reflect.StructOf oddity

2017-06-27 Thread Jon Bodner
ff of the wrong field. Any idea what's going on? https://github.com/golang/go/issues/15924 states that this shouldn't have happened. Thanks, Jon -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this grou

Re: [go-nuts] reflect.StructOf oddity

2017-06-27 Thread Jon Bodner
Hi Ian, I'll file the bug report. Thanks for explaining how wrapper methods work. I have a second test case with a pointer (and a successful attempt to multiply a string by 2): https://play.golang.org/p/Dq9Y8DAkvA Thanks, Jon On Tuesday, June 27, 2017 at 5:01:05 PM UTC-4, Ian Lance T

Re: [go-nuts] reflect.StructOf oddity

2017-06-27 Thread Jon Bodner
https://github.com/golang/go/issues/20824 On Tuesday, June 27, 2017 at 10:34:19 PM UTC-4, Jon Bodner wrote: > > Hi Ian, > > I'll file the bug report. Thanks for explaining how wrapper methods work. > I have a second test case with a pointer (and a successful attempt to >

[go-nuts] Re: Experience report on a large Python-to-Go translation

2020-02-03 Thread Jon Conradt
mostly because I find Python docs hard to read. Thank you for posting this very interesting experience report. Jon -- 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, sen

[go-nuts] Fuchsia Programming Language Policy

2020-02-25 Thread Jon Conradt
the techniques used to build tiny Docker images from Go, but I suspect they would like to have a much simpler route, e.g. a go build flag. Jon -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and sto

Re: [go-nuts] Fuchsia Programming Language Policy

2020-02-25 Thread Jon Conradt
It is nice to see the clarification. I can understand not using a GC language in the OS, but the previous wording did sound like it was unwelcome in their user land tools. Progress in getting their port of Go into the CI system would be encouraging. Jon On Tuesday, February 25, 2020 at 8

[go-nuts] Re: SIGILL running 1.14 on macOS

2020-02-29 Thread Jon Conradt
I am looking forward to 1.14.1, this ruined my Saturday. :( -- 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

[go-nuts] Re: SIGILL running 1.14 on macOS

2020-03-04 Thread Jon Conradt
You can follow the progress toward 1.14.1 via https://github.com/golang/go/milestone/137 Looking at 1.13.0 and 1.12.0 it looks like the time between a .0 release and a .0 release is about three weeks. So I'm hoping for a St. Patrick's Day releases of 1.14.1 Jon -- You received th

[go-nuts] An important proposal will fail without your support

2020-03-10 Thread Jon Perryman
mber), gettext.TimeLocal(time) ) The new gettext( ) is greatly simplified. Messages are now in a easily accessible GO module. There arel language specific message modules that are dynamically loaded as needed. E.g. en_jon.go where en is an English message module and jon is the first part of t

Re: [go-nuts] An important proposal will fail without your support

2020-03-10 Thread Jon Perryman
was ignored here. This proposal is not specific to gettext. A compile time language is a must and should be on GO's radar because many API's would benefit. This is a feature that will radically improve GO with little effort. You should "like" this proposal to let them know it'

Re: [go-nuts] An important proposal will fail without your support

2020-03-10 Thread Jon Perryman
plementation would be a couple thousand lines at most. By comparison, gettext is 115MB with 1500 files. We are so accustomed to bloated and labor intensive API's, that no one thinks it's a bad thing. A compile time language creates better and more readable code when used properly. Jon. -

Re: [go-nuts] An important proposal will fail without your support

2020-03-12 Thread Jon Perryman
made available to the function as ARGS. > I used make and awk programs that generate assembly code tuned > to the exact demands of command line make configuration. Then it builds in go, then runs. I want consistency for everyone, available with GO and easy to use. I'm sure this worked f

Re: [go-nuts] Re: Is there a way to create a global variable inside go routine stack? so that i can access any time, without passing around between methods/functions. Crazy thought !!!..

2020-05-26 Thread Jon Perryman
mutex.Unlock() g := Global{ Id : goroutineCount, Name : "some name", Cnt : 100, } g.Method1() } func (g *Global) Method1() { g.Method2() g.Cnt++ fmt.Println("method1", g.Id, g.Name, g.Cnt) } func (g *Global) Method2() { g.C

Re: [go-nuts] political fundraising on golang.org!

2020-06-14 Thread Jon Reiter
Except now sharing links to golang.org, or showing those web pages at events, could be argued as advocating for a foreign political cause. And that's illegal in much of the world. Per google, google operates in 219 countries. This could force community members to argue in any of at least 219 leg

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread Jon Reiter
y is violating them. NBut just because it's laws > I make wild claims about doesn't actually make the problems I talk about > real. > > On Mon, Jun 15, 2020 at 10:33 AM Jon Reiter wrote: > >> I'm sorry, I think this trivializes real concerns that impact a >> si

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread Jon Reiter
things happening. I do not think it is fair to equate this to orcs and wizards. On Mon, Jun 15, 2020 at 6:55 PM Axel Wagner wrote: > On Mon, Jun 15, 2020 at 11:56 AM Jon Reiter wrote: > >> It's not difficult to imagine banners like "free (some geographic place)" >&

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread Jon Reiter
the least of your worries. > > Also telling that you seem to explicitly call out the Go code of conduct > as not "impacting the entire community"? Surely I misunderstood that. Just > pointing that out to make clear that "it impacts the entire community" is > pretty muc

Re: [go-nuts] political fundraising on golang.org!

2020-06-15 Thread Jon Reiter
golang-nuts@googlegroups.com> wrote: > >> On Mon, Jun 15, 2020 at 1:04 PM Jon Reiter wrote: >> >>> Ok. I live in Singapore. Here is a statement from the Singapore Police >>> Force directly telling foreigners not to advocate for political causes or >>> ri

[go-nuts] Black Lives Matter question

2020-06-16 Thread Jon Perryman
Sorry for this being a little off topic but unlike the media which thinks with the heart, programmers tend to think with their head. I want to believe in the idea of "systemic police racism" over blaming all police for a few bad cops. Since this group supports the idea of "systemic police racism",

Re: [go-nuts] Generics: More on parens

2020-06-18 Thread Jon Conradt
shift-9 and option-shift-0 in a properly configured editor). Jon On Wednesday, June 17, 2020 at 7:25:36 AM UTC-7 Aaron Cannon wrote: > Thanks Ian for the reply. > > I certainly understand wanting to get more experience with the > proposed syntax, but I still don't think the tr

Re: [go-nuts] compiler RFE

2020-06-19 Thread Jon Perryman
" and much more. I strongly recommend you get familiar with your IDE otherwise you will get overwhelmed by large projects. Good luck, Jon. On Wed, Jun 17, 2020 at 12:15 PM wrote: > I remember using mainframe FORTRAN compilers where the compiler would > print out a page of symbol c

[go-nuts] generics draft and specialization

2020-06-20 Thread Jon Reiter
the draft lays out an example function GeneralAbsDifference. these comments build around that. i wanted to see how far i could get towards working specialization within this framework. the baseline assumption is that when specialization is required today the acceptable amount of type switching/a

Re: [go-nuts] generics draft and specialization

2020-06-21 Thread Jon Reiter
On Mon, Jun 22, 2020 at 12:00 PM Ian Lance Taylor wrote: > On Sat, Jun 20, 2020 at 10:48 PM Jon Reiter wrote: > > > > the draft lays out an example function GeneralAbsDifference. these > comments build around that. i wanted to see how far i could get towards > working

Re: [go-nuts] generics draft and specialization

2020-06-21 Thread Jon Reiter
sorry, previous is v unclear as it's assuming a solution to question 1 in clarification on question 2. amended below... On Mon, Jun 22, 2020 at 12:40 PM Jon Reiter wrote: > On Mon, Jun 22, 2020 at 12:00 PM Ian Lance Taylor wrote: > >> On Sat, Jun 20, 2020 at 10:48 PM

Re: [go-nuts] Re: Generics and parentheses

2020-07-17 Thread Jon Conradt
In the spirit of “show me, don’t tell me” and experience reports. How hard would it be to release a beta which supports both [] and guillamets? We try them. We see where we have compatibility problems. We give editor writers and plugin writers a chance to simplify they keystrokes? Jon On

Re: [go-nuts] Re: Generics and parentheses

2020-07-18 Thread Jon Conradt
It is a serious suggestion. Our editors are flexible enough to allow us to use control keys to generate these characters. Our ethnocentric, ASCII limited view of programming languages would benefit from more flexibility when it increases readability. Jon Jon Conradt —— j

Re: [go-nuts] Re: Proposal to add Index operator methods

2020-10-05 Thread Jon Reiter
i think this looks nice but realistically only cleans up v simple cases. a lot of the very-verbose-and-not-so-elegant-looking multidimensional math stuff looks "worse" than other languages because go doesn't have operator overloading. it is not clear to me this improves syntax too much in practic

Re: [go-nuts] Re: Cannot build after upgrading to Go 1.16

2021-02-24 Thread Jon Reiter
i had a similar experience where i ended up pull-requesting the addition of mod&sum into a dependency. fair enough for actively maintained packages or packages you've contributed to before but could be problematic otherwise. (insert any linux/bsd talk about contributing changes upstream here) it

Re: [go-nuts] Go 1.16 and modules

2021-03-29 Thread Jon Reiter
i think it's gentler to look at this in the context of c's "hello world" program. the first version was missing both #include and void. then it got #include. then it got void. i recall void issues with code from k&r v1 on my compiler in the mid 80s (i do not predate include statements). i recal

[go-nuts] proposal: infer module name via version control when running `go mod init`

2021-05-11 Thread Jon Calhoun
nough to the current behavior to be a good addition, but I admittedly haven't explored how easy/hard it would be to implement. Best, Jon -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receivin

Re: [go-nuts] proposal: infer module name via version control when running `go mod init`

2021-05-12 Thread Jon Calhoun
ohir wrote: > Dnia 2021-05-11, o godz. 11:14:24 > Jon Calhoun napisał(a): > > > it saves me a handful of keystrokes at best - so I understand if it > doesn't seem > > worth the effort. > > Right. > > > It feels close enough to the current behavior

Re: [go-nuts] proposal: infer module name via version control when running `go mod init`

2021-05-12 Thread Jon Calhoun
et someone familiar >> with each VCS take charge of that specific PR using existing VCS >> implementations as a pattern to follow. >> On Wednesday, May 12, 2021 at 7:28:11 AM UTC-4 ohir wrote: >> >>> Dnia 2021-05-11, o godz. 11:14:24 >>> Jon Calhoun napis

Re: [go-nuts] proposal: infer module name via version control when running `go mod init`

2021-05-12 Thread Jon Calhoun
;t be inferred from the location within $GOPATH/src. > > On Wed, May 12, 2021 at 11:01 AM Jon Calhoun wrote: > >> I suspect that the VCS path gives nearly the same level of confidence in >> practice. My personal experience shows that it is pretty rare for the two >> not to

[go-nuts] keyword= support for function calls

2023-08-16 Thread Jon Perryman
osed with "I don't see anything concrete being proposed here.". If I should pursue this, should I reword it or reduce it to this Email? Thanks, Jon. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

Re: [go-nuts] keyword= support for function calls

2023-08-16 Thread Jon Perryman
a struct whose contents can be initialized using the > struct member names. > > On Wed, Aug 16, 2023 at 6:04 PM Jon Perryman > wrote: > >> Do you feel your GOLANG API implementations allows your API's >> and functions to evolve and grow? Personally, positional args has

Re: [go-nuts] keyword= support for function calls

2023-08-16 Thread Jon Perryman
ok at net.Dialer <https://pkg.go.dev/net#Dialer>. It is > essentially a struct that adds optional, keyword arguments to net.Dial > <https://pkg.go.dev/net#Dial>. > > On Thu, Aug 17, 2023 at 3:44 AM Jon Perryman > wrote: > >> Struct does not solve the basic problem. In wh

Re: [go-nuts] Generic "nillable" constraint

2023-10-01 Thread Jon Watte
nto "zero values" or "comparables," but it's a pretty basic fundament of the runtime, so having to special-case everything about it is quite frustrating and cumbersome. Sincerely Jon Watte On Thursday, December 22, 2022 at 5:39:29 AM UTC-8 Axel Wagner wrote:

Re: [go-nuts] Generic "nillable" constraint

2023-10-02 Thread Jon Watte
his constraint: func Compact[T nil](s []T) ... Sincerely, Jon On Mon, Oct 2, 2023, 16:53 Ian Lance Taylor wrote: > There is a lot more on this topic at https://go.dev/issue/61372. > We're not sure how best to handle it. > > Ian > -- You received this message because you a

Re: [go-nuts] Generic "nillable" constraint

2023-10-03 Thread Jon Watte
o put "nil" in place of the "?" to make this work, and it would work for any reference type (that can be compared or assigned to nil.) Unless I'm missing something? Sincerely, Jon Watte -- "I find that the harder I work, the more luck I seem to have." -- Thom

Re: [go-nuts] Generic "nillable" constraint

2023-10-03 Thread Jon Watte
these kinds of affordances are typically a little more involved, but we would save a lot of boilerplate/repeated code if this constraint were available.) (Also, Infallible() could be a good standard library function, because it's common enough, but that's a totally different discussion t

Re: [go-nuts] Generic "nillable" constraint

2023-10-03 Thread Jon Watte
uot;can be compared or assigned to nil," then that clearly should be expressible in the generic type system, unless you for some reason want the the generic type system to be deliberately less expressive than the full type system, and deliberately want to exclude use cases like these. Sincerely,

Re: [go-nuts] Generic "nillable" constraint

2023-10-03 Thread Jon Watte
e! return nope } return val } func MaybeNuke(T any](b bool, val T) T { if b { return zero[T]{} // maybe? seems weird } return val } This is because not all zero values can be instantiated inline with simply T{}. Sincerely, Jon Watte -- "I find that the harder I work, the more lu

Re: [go-nuts] Generic "nillable" constraint

2023-10-17 Thread Jon Watte
m. That might indeed be a good solution -- but if so, it'd be nice to know what we can do to make that happen, and what the other opposition to that change might be, because that change also feels much less narrow than a "nil" type constraint. Sincerely, Jon Watte -- "

Re: [go-nuts] Generic "nillable" constraint

2023-10-18 Thread Jon Watte
though (there's a reason they aren't comparable!) and making everything comparable to nil without type qualification is better IMO. Sincerely, Jon Watte -- "I find that the harder I work, the more luck I seem to have." -- Thomas Jefferson On Tue, Oct 17, 2023 at 10:25 PM Axel

Re: [go-nuts] Strip HTML comments before processing template

2024-12-30 Thread Jon Perryman
is JS error. This is a Go runtime error. Not from browser > console, from terminal. > > > On Tue, Dec 31, 2024 at 02:33 Jon Perryman wrote: > >> *"can't evaluate field nonExistingData"* looks like a javascript error >> message because it says evaluated. HTM

Re: [go-nuts] Strip HTML comments before processing template

2024-12-30 Thread Jon Perryman
*"can't evaluate field nonExistingData"* looks like a javascript error message because it says evaluated. HTML would not evaluate stuff. The outer tics also make me think javascript. I inserted the statement (with & without outer tics) but don't get an error message on the console. On Mon, Dec 30,

Re: [go-nuts] Strip HTML comments before processing template

2024-12-31 Thread Jon Perryman
the relevant version of Go you used to >> compile your program and the particular package you believe is the source >> of the problem. A minimal reproducible example is also a good idea if >> feasible. >> >> In this case we're guessing you're using https://p

Re: [go-nuts] Strip HTML comments before processing template

2025-01-02 Thread Jon Perryman
You are ignoring the past, future and features of GOLANG HTML when you say HTML comments are removed as a default. I'm guessing the original design transmitted HTML comments and they just suppressed them. At some point, I'm guessing they will add a GOLANG HTML template switch that transmits HTML co

Re: [go-nuts] Memory share between 2 executables

2025-07-26 Thread Jon Perryman
> The standard and correct way to handle this is to embrace the client-server nature of gRPC. I could easily be wrong but my interpretation is that exec1 does not involve gRPC. It's implied that exec1 and exec2 are in the same process because the op expects the pointer will reference the same stor

Re: [go-nuts] Memory share between 2 executables

2025-07-25 Thread Jon Perryman
Caveat, I'm not familiar with gRPC nor your implementation. In addition to Robert's suggestions, have you considered a single executable using GoRoutines and channels. Maybe channels can be shared between 2 executables but I can't speak to that. You could run a test to see if it GO allows it. If s