Re: [go-nuts] Logging best practices with log/slog

2025-04-02 Thread Mike Schinkel
TextHandler(os.Stdout,nil)) logger.Info("Also not my handler. :-(") } Here it is in Go play: https://go.dev/play/p/Sqlny1oyRlS?v= -Mike -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rec

Re: [go-nuts] Logging best practices with log/slog

2025-04-01 Thread Mike Schinkel
control of logging from a package used by an app and give that control back to the app developer. A good place to start would be for all those packages that use log. -Mike P.S. One simple approach, at least for log, might be for the Go team to add (something like) a log.WriterFilter pac

Re: [go-nuts] Logging best practices with log/slog

2025-03-29 Thread Mike Schinkel
stency problem across 3rd party packages used by a Go app. And the fact there are a lot of strong conflicting opinions ensures we won't see a convergence to a defacto-standard approach to logging unless and until there emerges some new innovation for logging from the Go team. -Mike P.S. Ma

Re: [go-nuts] Potential language feature for testing value membership in if statements?

2025-03-19 Thread Mike Schinkel
given my intuition on this idea failed — and it clearly is a dead horse, with no hope for revival on the horizon — is there any upside to continue beating it? -Mike P.S. I was not planning to continue this thread because Ian shut down the idea so AFAICT further discussion was a moot point. O

Re: [go-nuts] Potential language feature for testing value membership in if statements?

2025-03-19 Thread Mike Schinkel
> On Mar 19, 2025, at 5:34 PM, Robert Engels wrote: > > I suspect if you wrote a small real world parser you would find a negligible > performance difference. I am writing a real-world parser. I'll benchmark it when I am done. -Mike -- You received this message because y

Re: [go-nuts] Potential language feature for testing value membership in if statements?

2025-03-19 Thread Mike Schinkel
> On Mar 19, 2025, at 1:55 PM, Ian Lance Taylor wrote: > > On Wed, Mar 19, 2025 at 10:43 AM Mike Schinkel wrote: >> >> Given these benchmark results, would the Go team reconsider such a language >> feature on a basis of performance vs. a comparison of synta

Re: [go-nuts] Potential language feature for testing value membership in if statements?

2025-03-19 Thread Mike Schinkel
> On Mar 18, 2025, at 8:40 PM, Ian Lance Taylor wrote: > > On Tue, Mar 18, 2025 at 4:51 PM Mike Schinkel wrote: >> >> While working on a parser, I've repeatedly encountered patterns like: >> >> if c == ' ' || c == '\t' { /* h

[go-nuts] Potential language feature for testing value membership in if statements?

2025-03-18 Thread Mike Schinkel
f c [some_syntax] ' ', '\t' { /* handle whitespace */ } Do you think that the Go team would be likely to consider such a proposal, or would taking the time to prepare and submit a proposal likely just be for naught? If this seems worthy of a proposal, what syntax do you thin

[go-nuts] Re: Why does using time.Time.Compare like this work?

2025-02-20 Thread Mike Schilling
Any method can be called as a normal function with the receiver as the first argument. Thus you can call time.Time.Compare(time1, time2) . On Thursday, February 20, 2025 at 9:57:35 AM UTC-8 cpu...@gmail.com wrote: > Sorry for not finding a better than this click bait subject. > > In https://git

[go-nuts] Re: Why does using time.Time.Compare like this work?

2025-02-20 Thread Mike Schilling
See "Method expressions" in the Go Programming Language Specification. On Thursday, February 20, 2025 at 10:30:22 AM UTC-8 Mike Schilling wrote: > Any method can be called as a normal function with the receiver as the > first argument. Thus you can call time.Time.Compare(time1

Re: [go-nuts] Practical OpenAPI in Go

2025-02-12 Thread Mike Schinkel
se clarify. -Mike > On Feb 12, 2025, at 10:56 AM, Alex Pliutau wrote: > > Curious to know how many of you are using it in your projects. > > https://packagemain.tech/p/practical-openapi-in-golang > > -- > You received this message because you are subscribed to the Go

Re: [go-nuts] "go-import" is great, we need "go-delete"

2025-02-06 Thread Mike Schinkel
need to delete existing packages, when they are malicious, and (primarily) making people aware of the specific vulnerability. Sorry for my inelegant wording. -Mike -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] Best Practices for Error Handling in Go APIs

2025-02-05 Thread Mike Schinkel
rors are passed in. Any exposed API > is most likely to be depended upon even when the designer didn't plan for it > to be used. Interesting idea. Want to tackle that refactor and then post an updated link? -Mike -- You received this message because you are subscribed to the Googl

Re: [go-nuts] Best Practices for Error Handling in Go APIs

2025-02-04 Thread Mike Schinkel
Stack() methods. Here is a example demoing how it works: https://go.dev/play/p/J9i1pxB0YFU <https://go.dev/play/p/J9i1pxB0YFU> Any follow up questions, feel free to ask. -Mike P.S. I threw this together to answer the question, but if anyone else notices something I missed or did wrong, it

Re: [go-nuts] Best Practices for Error Handling in Go APIs

2025-02-03 Thread Mike Schinkel
rning to the caller. Then document your sentinel error variables and commit to not renaming or removing them in future versions of your API. Does that answer your question? -Mike [1] https://go.dev/blog/errors-are-values <https://go.dev/blog/errors-are-values> [2] https://github.com

Re: [go-nuts] Is there a way to browse the stdlib packages in pkg.go.dev?

2025-02-02 Thread Mike Schinkel
ges in the project's file tree view for any Go project. Look at the bottom for the top-level node named "External Libraries" and then under that look for "Go SDK ". -Mike -- You received this message because you are subscribed to the Google Groups "golang-nuts&qu

Re: [go-nuts] PDF to text

2025-01-22 Thread Mike Schinkel
-case, please check it out (but be aware, my additions to the forked code are rather hacky): https://github.com/mikeschinkel/go-pdf-content-reader <https://github.com/mikeschinkel/go-pdf-content-reader> -Mike > On Jan 22, 2025, at 11:08 AM, Hugh Myrie wrote: > > I want to extract

Re: [go-nuts] Allow relaxed type casting on more general assignments?

2025-01-14 Thread Mike Schinkel
> On Jan 15, 2025, at 2:38 AM, 'Dan Kortschak' via golang-nuts > wrote: > > On Wed, 2025-01-15 at 02:33 -0500, Mike Schinkel wrote: >> When you say compatibility, what would be a use-case where existing >> code would break? Something related to using r

Re: [go-nuts] Allow relaxed type casting on more general assignments?

2025-01-14 Thread Mike Schinkel
> On Jan 15, 2025, at 12:05 AM, Ian Lance Taylor wrote: > > On Tue, Jan 14, 2025 at 8:10 PM Mike Schinkel wrote: >> >> P.S. If I instead asked that all funcs in the standard library accepting >> strings be converted to use that generic signature, I assume that wou

Re: [go-nuts] Allow relaxed type casting on more general assignments?

2025-01-14 Thread Mike Schinkel
> On Jan 14, 2025, at 8:06 PM, Ian Lance Taylor wrote: > > On Tue, Jan 14, 2025 at 4:19 PM Mike Schinkel wrote: >> >> Given this I am now pondering why it would not be possible and acceptable it >> Go could allow relaxing of the need to type cast — on an opt-in ba

[go-nuts] Allow relaxed type casting on more general assignments?

2025-01-14 Thread Mike Schinkel
d to opt-in where applicable, as that is where I would see the biggest benefit. -Mike P.S. I created a simple example showing a use-case how such relaxation might be used: https://go.dev/play/p/yllJ0CNZaAI -- You received this message because you are subscribed to the Google Groups "golang

Re: [go-nuts] Golang ORM Performances

2025-01-09 Thread Mike Schinkel
ave had SQL for right at 50 years[3], I am not holding my breath. #fwiw -Mike 1 — LINQ being an admitted subset and with a design that requires embedding into the language is unfortunately not a complete solution and it couples concerns. 2 — This is the core vs. context problem that Geoffrey

Re: [go-nuts] Golang ORM Performances

2025-01-07 Thread Mike Schinkel
tion that meets said requirements, for Go, or for the general-case even? -Mike -- 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...@

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

2025-01-01 Thread Mike Schinkel
, including comments containing dynamically generated data. Better to use template parser-compatible comments for your use-case, as Jon Perryman mentioned, than to limit what can be generated by the package -Mike > > On Dec 31, 2024 at 6

Re: [go-nuts] Is it necessary to change the behavior of maps.Keys and maps.Values?

2024-12-29 Thread Mike Schinkel
ecedence and consistency, it actually does. > Indeed. If we had more powerful generics (and had them from the beginning) we > could have chosen singular functions with simpler names here. Perhaps, in > the future, we *will* get those and can clean up here. On that we can certainly agree.

Re: [go-nuts] Is it necessary to change the behavior of maps.Keys and maps.Values?

2024-12-29 Thread Mike Schinkel
Writer.WriteRune() # archive/tar Package - Reader.Read() vs Reader.ReadString() - Writer.Write() vs Writer.WriteString() -Mike -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving email

Re: [go-nuts] Is it necessary to change the behavior of maps.Keys and maps.Values?

2024-12-29 Thread Mike Schinkel
nd consistency is taking steps toward the "fractal of bad design" that is PHP and its horrendous inconsistency in standard library function naming and parameter usage that people have complained about for decades. Anyway, I am not sure why you felt the need to add your voice to defend it because,

Re: [go-nuts] Is it necessary to change the behavior of maps.Keys and maps.Values?

2024-12-28 Thread Mike Schinkel
ValuesRange, or with some other suffix. But sadly, given the backward compatibility guarantee of Go, that ship has sailed. -Mike -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails f

Re: [go-nuts] Golang ORM Performances

2024-12-19 Thread Mike Schinkel
Hi Bhavesh, I am also not a fan of ORMs, but I am a big fan of sqlc so I will 2nd Brian Candler's recommendation. Sqlc is one of the few Go packages/tools I consider a must-use for any of my projects that need to interact with SQL databases. -Mike > On Dec 19, 2024, at 8:23 AM

Re: [go-nuts] Where should I define the errors in a Go project?

2024-12-03 Thread Mike Schinkel
As two examples, I refactored all cgo/Objective-C macOS API code out of `macosprefs` and into `macosutils` as I saw I could consolidate all macOS API code into a single package and while I was writing this I realized that `cobrautil` was a better name than `cliutil`. I hope this helps. -Mike &

[go-nuts] Are there plans to make coroutines a supported feature?

2024-10-20 Thread Mike Schilling
If so,is it likely. to look more like the current small API, of the larger one discussed in Russ Cox's Coroutines for Go? -- 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] Re: How to know if interface{} data is nil w/o reflecting?

2024-09-25 Thread Mike Graf
Sorry to revive this, but I'd like to add to conversation (without weighing in on correctness of the nil check) that it appears the CodeReview comments on interfaces ( https://go.dev/wiki/CodeReviewComments#interfaces ) and the FAQ nil error https://go.dev/doc/faq#nil_error give mutually exclus

Re: [go-nuts] Suppress GoFmt-generated error with/tools.go?

2024-09-02 Thread Mike Schinkel
> On Sep 2, 2024, at 8:40 PM, Ian Lance Taylor wrote: > > On Sun, Sep 1, 2024 at 1:08 AM Mike Schinkel wrote: >> >> Ian — if you are reading this — does this rise enough to the level of a bug >> — checking imports on a `go fmt` — that I should submit as an issue

Re: [go-nuts] Suppress GoFmt-generated error with/tools.go?

2024-09-01 Thread Mike Schinkel
> On Aug 31, 2024, at 9:45 AM, Axel Wagner > wrote: > > On Sat, 31 Aug 2024 at 14:22, Mike Schinkel <mailto:m...@newclarity.net>> wrote: > Hi Alex & Peter, > > Thank you both for your replies. > >> On Aug 30, 2024, at 2:43 AM, Axel Wagner > <m

Re: [go-nuts] Suppress GoFmt-generated error with/tools.go?

2024-08-31 Thread Mike Schinkel
> On Aug 31, 2024, at 8:29 AM, Jan Mercl <0xj...@gmail.com> wrote: > > On Sat, Aug 31, 2024 at 2:22 PM Mike Schinkel wrote: > >> go fmt ./tools.go > > 'go fmt' is not gofmt. They are different? Well that is positively confusing. Thank you for po

Re: [go-nuts] Suppress GoFmt-generated error with/tools.go?

2024-08-31 Thread Mike Schinkel
Hi Alex & Peter, Thank you both for your replies. > On Aug 30, 2024, at 2:43 AM, Axel Wagner > wrote: > I don't think that error message comes from gofmt. As far as I am aware, > gofmt only parses source code, it does not even do type-checking. As you sure about that? Running this: go fmt .

[go-nuts] Suppress GoFmt-generated error with/tools.go?

2024-08-29 Thread Mike Schinkel
really want to ensure no errors are generated unless they are errors I really need to fix. Otherwise I will likely get complacent and accidentally commit a real error. Is there any way to get gofmt to ignore code based on build tags, e.g. `tools` in this case? -Mike -- You received this message

Re: [go-nuts] Advice on Using Pure Go with eBPF

2024-08-14 Thread Mike Schinkel
I for one would really like to see Go or TinyGo find a way to target eBPF similar to how it can target WASM. -Mike > On Aug 14, 2024, at 4:40 PM, twp...@gmail.com wrote: > > For eBPF support in Go, see https://github.com/cilium/ebpf. > > AFAIK at the moment you can't com

Re: [go-nuts] How does bytealg.MakeNoZero() work?

2024-06-26 Thread Mike Schinkel
hat is, you can define your type as > type MyBuilder struct { > strings.Builder > } > and then add methods to that which use `unsafe` to do what you want. Though > that will, of course, also be dangerous and should be guarded with build tags > for the used Go version, at the

[go-nuts] How does bytealg.MakeNoZero() work?

2024-06-25 Thread Mike Schinkel
formant string builder, especially for larger strings: https://github.com/golang/go/commit/132fae93b789ce512068ff4300c665b40635b74e <https://github.com/golang/go/commit/132fae93b789ce512068ff4300c665b40635b74e> Any insight into `bytealg.MakeNoZero()` would be appreciated. -Mike -- You rec

Re: [go-nuts] Nillable basic types?

2024-03-21 Thread Mike Schinkel
Hi Axel, Thank you for that link. I had not seen it before, but it is rather insightful. -Mike On Wednesday, March 20, 2024 at 10:29:20 AM UTC-4 Axel Wagner wrote: FWIW I believe (as Brian sort of points out) this proposal is fully subsumed under #57644 <https://github.com/golang/go/iss

Re: [go-nuts] Nillable basic types?

2024-03-20 Thread Mike Schinkel
using interfaces as type constraints would address the concern. And as discussed, probably not. But it is an interesting thought exercise. If an interface-based solution could be found, it would address the concern without turning us effectively into Rust programmers. ¯\_(ツ)_/¯ -Mike --

Re: [go-nuts] Nillable basic types?

2024-03-20 Thread Mike Schinkel
On Wednesday, March 20, 2024 at 5:31:08 AM UTC-4 Brian Candler wrote: It's in the very first post that opened this thread, under the heading "## Summary". I did in-fact miss it. Thank you for pointing to it. -Mike -- You received this message because you are subscribe

Re: [go-nuts] Nillable basic types?

2024-03-20 Thread Mike Schinkel
uot;unset"* state for scalars. Or maybe I misread? Maybe the best thing to do is let him tell us what he was thinking? -Mike On Wednesday 20 March 2024 at 07:34:10 UTC Mike Schinkel wrote: On Mar 19, 2024, at 2:43 PM, Daniel Lepage wrote: I'm not proposing that *any* value be m

Re: [go-nuts] Nillable basic types?

2024-03-20 Thread Mike Schinkel
objectives you are seeking, or not? And if not, why not? Finally, for the Go team, if that would be meet his objectives, would extending type constraints in this manner be a viable potential? -Mike -- You received this message because you are subscribed to the Google Groups "golang-nuts

Re: [go-nuts] Why can't I use an interface which needs another interface inside of it

2024-03-13 Thread Mike Schinkel
nd in Go that something is often an interface. As stated though, interfaces in Go do not work with covariance types. #fwiw Lastly, a suggestion on naming. My understanding is that it would be more idiomatic to name `b.GetChilder` as `b.ChildGetter()` and `b.GetDataer` as `b.DataGetter()`;

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-09 Thread Mike Schinkel
my answer, and then explicitly attack me and my participation on this list when I posted a follow up showing the sanity checking I had done. I guess in your world, the only replies to this list that are reasonable are the ones you think are reasonable, and all others deserve a condescending response

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Mike Schinkel
this thread — except when you replied to my ask for clarification — was unnecessary as you had already made your only point. If there was trolling here, your reply to my first reply on the thread was the start of that trolling. -Mike P.S. The types of replies you've made on this thread is

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Mike Schinkel
at the performance of JSON parsing made indeed by one of the reasons she is seeing a difference. Pragya, it would be really nice if you could follow up to close the loop and let us know what the actual bottleneck was and how you ended up solving it. -Mike On Friday, March 8, 2024 at 9:58:26 PM

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Mike Schinkel
if so would prefer to know rather than wrongly assume. -Mike On Friday, March 8, 2024 at 8:28:38 PM UTC-5 Robert Engels wrote: > Just to be clear for others - from a raw cpu performance perspective when > looking at a typical application in whole - there is very little > performanc

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Mike Schinkel
https://kokizzu.blogspot.com/2022/12/map-to-struct-and-struct-to-map-golang.html Hope this helps. -Mike On Friday, March 8, 2024 at 4:15:25 PM UTC-5 Robert Engels wrote: > It is highly unlikely that the Go marshaling is the cause. I’m guessing > you are probably not using a b

Re: [go-nuts] Enums, Go1 and proposals

2024-03-04 Thread Mike Schinkel
s of `struct` and `[...]array` are assignable to a `const`, and 2. Casting a literal to a `struct` `[...]array` type would instantiate the type and assign the literal's value to the first element or property. https://goplay.tools/snippet/xuGipbUVlKz <https://goplay.tools/snippet/xuGipbUVlK

Re: [go-nuts] Enums, Go1 and proposals

2024-03-04 Thread Mike Schinkel
> On Mar 4, 2024, at 12:18 PM, Jeremy French wrote: > > More, to prevent PrintMonth(14) which the function would have to check for > and either return an error or panic, since there is no meaningful output. ... > I was more just answering Mike Schinkel's question a

Re: [go-nuts] Enums, Go1 and proposals

2024-03-03 Thread Mike Schinkel
ank you in advance to whoever helps me understand why enums are such as burning desire for so many developers. -Mike > On Mar 3, 2024, at 12:25 AM, Nicolas Serna > wrote: > > Hello, gophers. Lately I've been working quite a bit with enums as I'm moving > a C program I

Re: [go-nuts] Ghost/indirect dependency on a custom package

2024-02-20 Thread Mike Schinkel
Is there no `cmd/migrations/go.mod`? Have you not tried debugging with Delve? -Mike On Tuesday, February 20, 2024 at 5:29:19 AM UTC-5 Peter Bočan wrote: > That seems to work on the repo/go.mod level, if I am not mistaken. I would > need something finer on the binary/compilation unit

Re: [go-nuts] Re: Trying to understand aversion to main package

2024-02-14 Thread Mike Schinkel
nal/testscript for testing complete application behaviour. These both are really the essential answer to your question. I just did not think of it when I first replied. -Mike -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscr

[go-nuts] Re: Trying to understand aversion to main package

2024-02-14 Thread Mike Schinkel
rious. If you prefer to put more in `main()` then AFAIK there are no real issues with it other than lacking package reusability, so if it works for you, knock yourself out. #jmtcw -Mike On Wednesday, February 14, 2024 at 6:12:49 AM UTC-5 Jerry Londergaard wrote: > I see quite a few modules o

Re: [go-nuts] Is there a way to cast interface to embedded type?

2024-02-09 Thread Mike Schinkel
pty `Base()` method — and then type assert to it after which, if it succeeds you can type assert to `*Base`, like so: https://go.dev/play/p/-gcKGf4_AFg <https://go.dev/play/p/-gcKGf4_AFg> Hope this helps. -Mike -- You received this message because you are subscribed to the Google Groups

[go-nuts] Re: Blog Article: Go Generics (and also mocking)

2024-01-08 Thread Mike Schinkel
nflicts. Rather than "go-mock" it would be better IMO if the OP had named it *(something like) **"*go-vermock" *(the company he works for is Versant) *and if he chose to name his CLI "vermockgen," or similar. -Mike #jmtcw #fwiw -- You received this message

Re: [go-nuts] Type parameter embedded field

2024-01-06 Thread Mike Schinkel
ameter. That is unless there is some other unintended consequences I am not seeing and you have not mentioned. -Mike P.S. Ironically, ensuring the benefits of embedded type parameters are *"too small"* is itself a class of NP problem. -- You received this message because you ar

Re: [go-nuts] Type parameter embedded field

2024-01-06 Thread Mike Schinkel
ss there are objective arguments for why that can't reasonably be compiled, or there are unintended conflict elsewhere in the language? -Mike [1] https://www.youtube.com/watch?v=yE5Tpp2BSGw -- You received this message because you are subscribed to the Google Groups "golang-nuts&quo

Re: [go-nuts] Type parameter embedded field

2024-01-05 Thread Mike Schinkel
create a struct with both type parameters and use with types that create ambiguity — such a compromise would stop perfect from being the enemy of the good. Anyway, as stated this is a strawman proposal. Please shoot holes in it if there are any opportunities to do so. -Mike -- You received this

Re: [go-nuts] Is "When in doubt, use a pointer receiver" misleading advice?

2023-11-16 Thread Mike Schinkel
was mentioned in this discussion, here <https://groups.google.com/g/golang-nuts/c/Qb4IAEbpziU/m/l1ehl2yDBQAJ>. -Mike -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

Re: [go-nuts] Is "When in doubt, use a pointer receiver" misleading advice?

2023-11-15 Thread Mike Schinkel
> On Nov 15, 2023, at 7:08 AM, 'Brian Candler' via golang-nuts > wrote: > > On Tuesday, 14 November 2023 at 03:38:04 UTC Mike Schinkel wrote: > 1. A value variable and multiple value receivers <--- compiles > 2. A pointer variable and multiple value receive

Re: [go-nuts] Re: Is "When in doubt, use a pointer receiver" misleading advice?

2023-11-14 Thread Mike Schinkel
e 1 submits the object to the channel it should no longer attempt to access it.)* Or again, am I missing something obvious? -Mike -- 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] Re: Is "When in doubt, use a pointer receiver" misleading advice?

2023-11-14 Thread Mike Schinkel
didn't explain it in his post. Robert Engels seems to be saying this isn't conceptually a data race but it is an unfortunate artifact of how the compiler works? -Mike -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubsc

[go-nuts] Re: Is "When in doubt, use a pointer receiver" misleading advice?

2023-11-13 Thread Mike Schinkel
mix receiver types not more useful in practice? If the developer makes a mistake and passes a non-pointer interface value to a method with a pointer receiver they will get a compile error, so there does not appear to be any downside for changing the recommendation regarding consistency wit

Re: [go-nuts] Re: I think in Golang, Array, Slice, and Map , all of them are very difficult to use。

2023-11-09 Thread Mike Schinkel
o know it for several months before judging it. If you are anything like me, you will come to appreciate Go by leaps and bounds more than working with PHP. #fwiw -Mike On Thursday, November 9, 2023 at 12:35:38 PM UTC-5 Viktoriia Kapyrina Yelizarova wrote: > Well, reflection is one of the

[go-nuts] Re: Any option to substitute plug-in package ?

2023-10-28 Thread Mike Schinkel
Oops! Meant to say *“Using Lua to develop plugins in Go would NOT be ideal IMO.”* On Saturday, October 28, 2023 at 10:47:56 PM UTC-4 Mike Schinkel wrote: > I recently started using github.com/yuin/gopher-lua for a project to > allow users to add filtering criteria that would be

[go-nuts] Re: Any option to substitute plug-in package ?

2023-10-28 Thread Mike Schinkel
in <https://github.com/hashicorp/go-plugin> or similar as others have recommended, and then only fall back to Lua when you want to allow end-users who are not Go developers to extend your app in small ways. #jmtcw #fwiw -Mike P.S. You could also use JavaScript <https://prasanthmj.gith

Re: [go-nuts] Can Generics match implementers of an interface?

2023-10-23 Thread Mike Schinkel
Absolutely, some times generics are not needed. I actually don't find a need to use them that often which is probably why when I came across a use-case that really needed them I was so stumped as to how make it work. Kudos again to Axel for helping me recognize my blindspot. -Mike P.S

Re: [go-nuts] Can Generics match implementers of an interface?

2023-10-23 Thread Mike Schinkel
entitled *"Inferring based on interfaces."* Again, it sure would be nice it this were possible, if for no other reason than to keep others being as time-inefficient as I was while trying to figure it out. -Mike On Sunday, October 22, 2023 at 11:01:47 PM UTC-4 tapi...@gmail.com wr

Re: [go-nuts] Can Generics match implementers of an interface?

2023-10-22 Thread Mike Schinkel
How so? Can you give an example scenario where it could cause unintended consequences? Or some other negative? -Mike On Saturday, October 21, 2023 at 11:57:52 PM UTC-4 tapi...@gmail.com wrote: It is hard to call such type inference better. That is too aggressive. -- You received this

Re: [go-nuts] Can Generics match implementers of an interface?

2023-10-21 Thread Mike Schinkel
ot; in https://github.com/golang/go/issues/58650 > Until then, it's expected that there will be some cases where you need to > specify the types. > > On Sat, Oct 21, 2023 at 9:45 PM Mike Schinkel > wrote: > >> No, that pre-generics case is not sufficient for my use-

Re: [go-nuts] Can Generics match implementers of an interface?

2023-10-21 Thread Mike Schinkel
See full code in playground <https://goplay.tools/snippet/FwSn1BaWg7k>. On Saturday, October 21, 2023 at 3:15:03 PM UTC-4 Dan Kortschak wrote: > On Sat, 2023-10-21 at 11:58 -0700, Mike Schinkel wrote: > > Recently I was trying to write a func using generics where I wanted > >

[go-nuts] Can Generics match implementers of an interface?

2023-10-21 Thread Mike Schinkel
Recently I was trying to write a func using generics where I wanted to use a slice of an interface that would contain implementers of that interface and then pass those types to a generic function, but I ran into this error: type MyStruct of MySlice{} does not match inferred type MyInterface for

Re: [go-nuts] Re: Recommended way to distribute pre-compiled C-dependencies for modules using CGO ?

2023-10-16 Thread Mike Schinkel
ds a `//go:embed` comment, converts your files into Go source code, compiles that code, and then provides a package that allows you to write those files to disk from an your Go app before you need to load the libraries. Maybe this will work for you? If yes, would love to hear back how it wor

[go-nuts] Re: [slog] customize defaultHandler

2023-08-28 Thread Mike Schinkel
show me how to get it to work.) -Mike On Monday, August 28, 2023 at 12:50:50 PM UTC-4 Tamás Gulácsi wrote: slog.SetDefault(slog.New(myHandler{Handler:slog.Default().Handler})) vl...@mailbox.org a következőt írta (2023. augusztus 28., hétfő, 15:06:37 UTC+2): Hi, When reading trough the log

Re: [go-nuts] Reason for "goto jumps over declaration" being disallowed

2023-08-26 Thread Mike Schinkel
gue would be clearer since the reader doesn't have to look at what > follows the "end" label. The pattern has an `end:` label always at or near the only return in the func, and (almost) never any other labels so a reader need not look for it after recognizing the pattern.

Re: [go-nuts] Reason for "goto jumps over declaration" being disallowed

2023-08-26 Thread Mike Schinkel
nk you. -Mike > On Aug 26, 2023, at 7:00 PM, Ian Lance Taylor wrote: > > On Sat, Aug 26, 2023 at 2:11 PM Mike Schinkel wrote: >> >> Question about disallowing `goto ` jumping over a variable >> declaration? >> >> >> And please, before bikes

[go-nuts] Reason for "goto jumps over declaration" being disallowed

2023-08-26 Thread Mike Schinkel
in advance. -Mike -- 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 vi

[go-nuts] Re: Best IDE for GO ?

2023-08-26 Thread Mike Schinkel
If I understand what you are asking then JetBrains GoLand does. I do not know if there is a way to use the keyboard, but it does provides links you can click when it displays the call stack on panic. -Mike On Saturday, August 26, 2023 at 8:33:08 AM UTC-4 Jason E. Aten wrote: > Is there

[go-nuts] Re: Best IDE for GO ?

2023-08-25 Thread Mike Schinkel
r off finding an ALM solution and then an IDE that integrates with that ALM, or vice versa, i.e. find an IDE that integrates with an ALM and then use that ALM. #fwiw -Mike On Wednesday, August 23, 2023 at 7:21:46 AM UTC-4 alex-coder wrote: > Hi All ! > > Considering that IBM's punch ca

[go-nuts] Re: Best IDE for GO ?

2023-08-22 Thread Mike Schinkel
those nicely. Can you elaborate on the specific dependencies you are trying to manage? In specific, vs generalities. -Mike -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails f

Re: [go-nuts] [RFC] Yet another proposal for Go2 error handling

2023-07-03 Thread Mike Schinkel
addressed. In hindsight I would remove the mention of motivation if I could so as not to be misinterpreted. #justfyi #fwiw -Mike On Monday, July 3, 2023 at 2:03:00 AM UTC-4 Henry wrote: > I don't think it has anything to do with motivation, Mike. The problem I > see is that there is no

Re: [go-nuts] [RFC] Yet another proposal for Go2 error handling

2023-07-02 Thread Mike Schinkel
day"* approach will address the reason people ask for a new language feature. And especially for error handling improvements, which is near the top of the things people want to see improved in Go, per the Q1 2023 Go Developer Survey[1]. #fwiw -Mike [1] Go Developer Survey 2023 Q1 Res

Re: [go-nuts] [RFC] Yet another proposal for Go2 error handling

2023-07-01 Thread Mike Schinkel
fmt* could be modified, but allowing that formatting strikes me as even more *non*-Go idiomatic than added a *when* command. That said, I am not personally advocating for a *when* command, I was just comparing *when err != nil goto * with the OP and proposer's *when err handle *. #fwiw -Mik

Re: [go-nuts] [RFC] Yet another proposal for Go2 error handling

2023-06-29 Thread Mike Schinkel
s.New("no funds")* *} *8. Using the example above, is there not a way to also annotate the error in a shared manner vs. having to have all the different handle labels and duplicated code? -Mike -- You received this message because you are subscribed to the Google Groups &q

Re: [go-nuts] catching an internal/poll error?

2023-02-21 Thread Mike Nolta
Sure: https://github.com/golang/go/issues/58622 Thanks very much, -Mike On Tue, Feb 21, 2023 at 12:23 AM Ian Lance Taylor wrote: > On Sun, Feb 19, 2023 at 11:10 AM Mike Nolta wrote: > > > > My code recently died with this error string: "write |1: > copy_file_ra

[go-nuts] catching an internal/poll error?

2023-02-19 Thread Mike Nolta
7;m not allowed to import it. Go version is 1.18.10, OS is ubuntu-latest from github actions. Thanks, -Mike [1]: https://cs.opensource.google/go/go/+/refs/tags/go1.20.1:src/internal/poll/fd.go;l=35 -- You received this message because you are subscribed to the Google Groups "golang-nu

[go-nuts] why no archive distribution for darwin 1.20.1?

2023-02-14 Thread Mike Andrews
on https://go.dev/dl/ i only see the packaged version this time: go1.20.1.darwin-amd64.pkg whereas historically there have been targz versions as well, such as go1.20.darwin-amd64.tar.gz last time. the targz's are useful to me for controlling and augmenting/customizing the installation. thank

Re: [go-nuts] please continue High Sierra mac OSX support

2023-02-05 Thread Mike Schinkel
taken into consideration but I wanted to add more details about how much hardware like this is available and what people might be using it for. -Mike P.S. I'll follow up over on the ticket, too. On Friday, February 3, 2023 at 1:36:03 PM UTC-5 Ian Lance Taylor wrote: > On Fri, Feb 3, 2023 at 9:4

Re: [go-nuts] Help Bootstrapping to ESXi

2023-01-13 Thread Mike Schinkel
inally, I wonder if someone on the list would be able to help me get around that error and continue exploring the compilation and execution of Go programs on an ESXi server from within the ESXi SSH shell? Thanks in advance for any insight into this. -Mike > > Hopefully that provides so

[go-nuts] Re: Help Bootstrapping to ESXi

2023-01-09 Thread Mike Schinkel
Is your ESXi server not running an Intel x86 processor? That is what the article is about. Also, what OS is your guest VM running? -Mike On Monday, January 9, 2023 at 4:20:15 PM UTC-5 brett@gmail.com wrote: > Good afternoon, hoping to get a little help. > > I am trying t

Re: [go-nuts] CRC32C with seed value

2022-12-12 Thread Mike Campin
Shouldn't the polynomial be 0x1EDC6F41 instead of 0x1EDC6F1 On Saturday, July 11, 2015 at 10:18:15 AM UTC-7 Joe Poirier wrote: > On Sat, Jul 11, 2015 at 10:25 AM, Akira Hayakawa > wrote: > >> Hi, >> >> I am at loss how I can compute crc32c hash value with given seed. >> >> Some C libraries incl

Re: [go-nuts] Idea for a language addition for error handling: inject/eject

2022-11-11 Thread Mike Schinkel
me to stick with Go moving forward. #fwiw -Mike On Wednesday, November 9, 2022 at 4:42:55 PM UTC-5 paurea wrote: > On Wed, Nov 9, 2022, 20:47 Ian Lance Taylor wrote: > >> On Wed, Nov 9, 2022 at 10:40 AM Gorka Guardiola wrote: >> >> Seems related to https://go.dev/issue/543

Re: [go-nuts] Preemptive interfaces in Go

2022-08-10 Thread Mike Schinkel
xperience those are often frowned on. Which, the moral of the story is: strive not to change interfaces once published and in use when and if you can avoid it. -Mike [1] Go Written As If Java -- You received this message because you are subscribed to the Google Groups "golang-nuts" gro

[go-nuts] Re: generics compile error: struct does not match interface, cannot infer type

2022-06-20 Thread Mike Andrews
here's an example more like my specific use case that i just mentioned, with the surprising inference behavior --- https://go.dev/play/p/BNmjlYejawZ On Monday, June 20, 2022 at 9:21:34 AM UTC-4 Mike Andrews wrote: > great, thanks brian, works like a charm. surprisingly, even wor

[go-nuts] Re: generics compile error: struct does not match interface, cannot infer type

2022-06-20 Thread Mike Andrews
f the concept per se? On Monday, June 20, 2022 at 8:44:06 AM UTC-4 Brian Candler wrote: > Type inference doesn't work in all cases. When required, just be explicit: > > interfaceFunc[string](x) > > https://go.dev/play/p/j66sXsfMUBl > > On Monday, 20 June 2022 at

[go-nuts] generics compile error: struct does not match interface, cannot infer type

2022-06-20 Thread Mike Andrews
anyone know why this simple case doesn't compile? i'm trying to call a function defined for generic interface type, which fails to compile for struct instance: https://go.dev/play/p/Y3Gdr2ILpK4 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

  1   2   >