[go-nuts] Re: Checking if two map variables refer to the same map

2018-08-07 Thread mike
Sorry for bumping a very old thread, but I absolutely disagree with the people stating that this problem is contrived, and I got here from a Google search, so this might be relevant for some people. A very real use-case for reference-comparing maps is when testing .Clone() methods. You want to

[go-nuts] Go NaCl and C NaCl/libsodium

2019-07-12 Thread mike
me. I am a little unclear as to whether the Go routines are compatible with crypto_box_open or libsodium's crypto_box_open_easy, for example. -- Mike :wq -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

Re: [go-nuts] Can -static be specified in a #cgo LDFLAGS directive?

2016-11-09 Thread mike
merely controlled static-ness, and can only be used from package main/main.go? -Mike On Wednesday, December 2, 2015 at 5:18:23 PM UTC-8, Ian Lance Taylor wrote: > > On Wed, Dec 2, 2015 at 4:24 PM, Tim K > > wrote: > > > > Thank you. Should an issue be opened for adding

[go-nuts] Importing a main package

2016-07-05 Thread Mike
just its main package code into mine, give it a new package name and compile but I can't stay in sych with the tool code base (in github) in a clean way. what is your recommended way of doing this? Thanks, Mike -- You received this message because you are subscribed to the Google Group

Re: [go-nuts] Re: [ANN] A GC-friendly and fast StatsD client

2016-07-29 Thread mike
Hi Alexandre, If I .Clone() a statsd.Client, say in a go-routine, do I need to .Close() the clone? Thank you, Mike On Monday, March 21, 2016 at 7:32:24 AM UTC-5, Alexandre Cesaro wrote: > > I just released statsd.v2 <https://github.com/alexcesaro/statsd>. > > The API is mor

[go-nuts] Re: cgo can't find .so in same directory

2020-04-30 Thread mike
https://golang.org/cmd/cgo/ > When the cgo directives are parsed, any occurrence of the string ${SRCDIR} will be replaced by the absolute path to the directory containing the source file. So this might be what you need. #cgo LDFLAGS: -L${SRCDIR}/. -lperson On Thursday, 30 April 2020 05:19:36

[go-nuts] Re: Converting a C char[] to []byte of string with cgo

2020-04-30 Thread mike
C.GoString((*C.char)(&p.hostname)) -- 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

[go-nuts] Re: help understanding weird Benchmark results

2020-05-19 Thread mike
As Michael Jones said, you still need to play by the testing package's benchmark rules for it to be able to benchmark your code. So something along these lines. func BenchmarkMarshalSample(b *testing.B) { for i:=0; i < b.N; i++ { var sum int64 // start := time.Now() f

[go-nuts] Re: Are you doing unit, module, and systems tests? If not, why not?

2018-03-13 Thread Mike Crilly
27;s "Writing Solid Code"): > > const debug = false > … > if debug { > if impossibleCondition { > panic(“impossible condition”) > } > } > > Matt > > On Tuesday, March 13, 2018 at 1:11:56 AM UTC-5, Mike Crilly wrote: >> >> I'

[go-nuts] [ANN] Golem: A general purpose, interpreted scripting language

2018-10-08 Thread Mike Jarmy
This is the initial announcement for Golem. Golem is a general purpose, interpreted scripting language, that brings together ideas from many other languages, including Go, Python, Javascript and Lua. Golem can be used as a command-line application, or it can be easily embedded inside a Go prog

[go-nuts] Re: Vue-inspired library with Go+WebAssembly

2019-03-29 Thread Mike Schinkel
it? I would be really interested if it could become a commercial product so that I could have better confidence of it being supported. -Mike On Friday, March 29, 2019 at 12:39:42 AM UTC-4, Brad wrote: > > Now that WebAssembly is available as an (experimental) compilation target, >

[go-nuts] Re: Vue-inspired library with Go+WebAssembly

2019-03-29 Thread Mike Schinkel
Oops. I think I spoke to soon. I don't think what you have is an alternative to Lorca, but an alternative to Vue.js *(which might still be interesting.)* *Whoever is moderating **if you see this in time **please just delete both messages.* On Friday, March 29, 2019 at 12:39:42 AM UTC-4, Brad w

Re: [go-nuts] Re: Vue-inspired library with Go+WebAssembly

2019-03-30 Thread Mike Schinkel
; > Yeah, it's different. But it would certainly be cool to have a solution that > provides an Electron-like shell around a Vugu application. I'll make an > issue for it so it's noted for later. > > On Friday, March 29, 2019 at 9:12:31 PM UTC-7, Mike Schinkel wro

[go-nuts] [blog] Generic Adapters + a question about reflection

2017-08-20 Thread Mike Houston
he types of all arguments during each invocation. Any thoughts on how to reduce some of the overhead would be welcome, but I'm prepared to accept that this is just the cost of making these wrappers at runtime with the current reflection support. Mike. -- You received this messa

[go-nuts] Extending net/http to make managing security relevant HTTP response headers easier

2017-08-22 Thread Mike Samuel
I'd appreciate feedback on a Go library I'm planning that might be of interest to people who write Go web frontends, https://tinyurl.com/sec-header-sets is the design doc. """ A proposed library that provides safe defaults (with opt-out) for security-relevant HTTP response headers. Background A

[go-nuts] error in docs - https://golang.org

2017-11-16 Thread Mike C
Hi all, i found an error in the example for https://golang.org/pkg/regexp/#Regexp.FindAllStringSubmatch but im not sure were to report that. I tried checking in https://github.com/golang/go/issues but that doesn't seem to be the place. Any ideas on where do docs issues go ? Cheers,

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-25 Thread Mike Schinkel
Marcus Low wrote: > > datalen := removedKeyken // removedKeyken must have been int32 in your > example. > if value != nil { >datalen = len(value) > } > The issue with this is it makes two assignments when value != nil instead of just one. -- You received this message because you are subsc

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-25 Thread Mike Schinkel
Andrew Klager wrote: > > Is this so bad? > > func ternary(cond bool, pos, neg interface{}) interface{} { > if cond { > return pos > } else { > return neg > } > } > > color := ternary( temp < 80, "blue", "red" ) > The issue with that proposal is both true and false expressions are always e

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-25 Thread Mike Schinkel
On Thursday, April 25, 2019 at 10:20:54 AM UTC-4, Sam Whited wrote: > > On Wed, Apr 24, 2019, at 14:08, Mark Volkmann wrote: > > Are there really developers that find this unreadable? > > > > color := temperature > 80 ? “red” : “green” > > Yes. > > What is "?"? If I've never seen that before I

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-26 Thread Mike Schinkel
overwritten: var result string if temperature > 80 { result = "red" } else { result = "green" } And it would do those things without the downsides mentioned thus far in this thread. -Mike P.S. And for me personally, it would help reduce the carpel-tunnel flareups I ge

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-26 Thread Mike Schinkel
I was assuming the compiler did not eliminate it. If it does then my point is moot. -Mike Sent from my iPad > On Apr 26, 2019, at 9:13 AM, Ian Lance Taylor wrote: > >> On Thu, Apr 25, 2019 at 10:57 PM Mike Schinkel wrote: >> >> Marcus Low wrote: >>&

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-28 Thread Mike Schinkel
mainly looking at CSS here, not Go.) I for one pine for a day that will likely never come when transpilers are no longer needed for development (I am not referring to go generate here, but tools to input one language and output another.) JMTCW. -Mike -- You received this message because you

[go-nuts] Re: Do Any Editors Support Customisable Code collapsing?

2019-07-18 Thread Mike Schinkel
> > Are there any editors that support some kind of customisable collapsing > behaviour? Where the above code could be collapsed to something like: > Might be worth reading, commenting on and/or possibly upvoting this feature proposal for GoLand? https://youtrack.jetbrains.com/issue/GO-7747 -

[go-nuts] Compiling very old version of Golang...

2016-07-04 Thread Mike Lee
Hello, For this question please refer to commit 0cafb9ea3d3d34627e8f492ccafa6ba9b633a213 of the Go repository. This is a very early version of Go (2008). I was just curious as to how it looked at the start. I don't have any experience in compilers/language design, can someone tell me how they

Re: [go-nuts] Compiling very old version of Golang...

2016-07-05 Thread Mike Lee
s showed up when there was enough of a library to make one > worth writing, and went away as soon as was feasible, when the go tool > showed up (as was always the plan). > > -rob > > > On Mon, Jul 4, 2016 at 8:32 PM, Mike Lee > > wrote: > >

[go-nuts] Call for Proposals: GORUCO 2017, NYC, June 24th

2017-03-12 Thread Mike Dalessio
e well received. More details are below. Thanks for your consideration, -mike --- *# GORUCO 2017 is now accepting talk proposals!* On Saturday, June 24th, [GORUCO][] is celebrating its 11th convocation as NYC's premier regional software conference. It's a one-day, single-track e

Re: [go-nuts] When set time.Location, will be detected Data Race

2020-07-24 Thread Mike Cohen
that method, I'm > a littlesurprised at what you describe, since it just uses the > timezone in theJSON string. It doesn't use the local timezone as far > as I can see.Can you show a small program that demonstrates the > problem? > Ian -- Mike Cohen Digital Paleontologist

Re: [go-nuts] When set time.Location, will be detected Data Race

2020-07-24 Thread Mike Cohen
> that will do this. Or fork it yourself - it is not a lot of code. > > On Jul 24, 2020, at 11:15 AM, Mike Cohen > > wrote: > > > > To be clear, the time.MarshalJSON() function produces valid RFC > > 3339 timestamps which allow arbitrary timezones. This me

[go-nuts] Re: Generics and parentheses

2020-08-06 Thread Mike Schinkel
JMTCW: I think using square brackets [...] instead of parenthesis (...) is a good decision. And as someone whose programming experience has not been in C++ or Java, I always found angle brackets for generics to be rather confusing but do not find square brackets as confusing. So in my mind,

Re: [go-nuts] Generics and parentheses

2020-08-06 Thread Mike Schinkel
contravariance — but perhaps those can be addressed in the future? All in all, I think the team has come up with a really good approach to generics, much better than the prior proposals. -Mike P.S. If there is one thing that piqued my interest about this thread it was Geoff Speicher's suggestion

[go-nuts] basics of understanding golang memory usage

2020-08-14 Thread Mike Spreitzer
is # HELP go_memstats_sys_bytes Number of bytes obtained from system. # TYPE go_memstats_sys_bytes gauge go_memstats_sys_bytes 7.1762168e+07 Thanks, Mike -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this grou

[go-nuts] Re: basics of understanding golang memory usage

2020-08-17 Thread Mike Spreitzer
FYI, after asking on Slack I got some useful pointers: - https://golang.org/pkg/runtime/#MemStats - definitions of memory stats from the golang runtime - https://github.com/prometheus/client_golang/blob/master/prometheus/go_collector.go - the code that publishes golang runtime memory stats as

[go-nuts] Re: basics of understanding golang memory usage

2020-08-17 Thread Mike Spreitzer
s in the coredump so huge? Does it correspond to anything in any of the other views? What do the three big anonymous blocks in the procfs view correpond to in the other views? Thanks, Mike -- You received this message because you are subscribed to the Google Groups "golang-nuts" gr

[go-nuts] Re: go test -timeout 30m can this be set inside Go code? disable timeouts programmatically?

2020-08-21 Thread Mike P
I was able to accomplish this via the flag library in my testing function: flag.Set("test.timeout", "30m0s") I found that being read from here: https://github.com/golang/go/blob/d21953df047868ed3bcfd0172a6c1672642f5b4a/src/cmd/go/testdata/script/test_timeout.txt#L22 So then I just changed the L

Re: [go-nuts] Re: go test -timeout 30m can this be set inside Go code? disable timeouts programmatically?

2020-08-21 Thread Mike P
Actually, that doesn't work. My apologies. If I figure it out, I will reply. On Fri, Aug 21, 2020 at 11:27 AM Mike P wrote: > I was able to accomplish this via the flag library in my testing function: > > flag.Set("test.timeout", "30m0s") > > ​ > >

RE: [go-nuts] Debug http calls made using go http client

2020-08-23 Thread Mike Spreitzer
Krishna can put a use of TCPMon or tcpdump inside the Kubernetes Pod. Either of these things can be added to the main container, or put in another container in the Pod. Regards, Mike golang-nuts@googlegroups.com wrote on 08/23/2020 01:06:20 PM: > From: "Tamás Gulácsi" >

Re: [go-nuts] Re: basics of understanding golang memory usage

2020-08-23 Thread Mike Spreitzer
BTW, how are you measuring RSS? That is a trick in and of itself! https://groups.google.com/g/golang-nuts/c/LsOYrYc_Occ/m/LbjLAsL6BwAJ Regards, Mike golang-nuts@googlegroups.com wrote on 08/18/2020 01:56:30 AM: > From: Mike Spreitzer > To: golang-nuts > Date: 08/18/2020 01:56 AM

Re: [go-nuts] Mysterious RSS memory spike

2020-08-23 Thread Mike Spreitzer
BTW, how are you measuring RSS? That is a trick all by itself! See https://groups.google.com/g/golang-nuts/c/LsOYrYc_Occ/m/LbjLAsL6BwAJ Regards, Mike golang-nuts@googlegroups.com wrote on 08/23/2020 11:04:47 AM: > From: Manish R Jain > To: "golang-nuts" > Date:

Re: [go-nuts] Any recommendation for structured logging library in Golang?

2020-11-17 Thread Mike Spreitzer
s key-value pair for > each line which is just too verbose to have the extra "time=" "file=". > Please let me know the one you actually use. > > Thanks! > Chris How about one that has fine-grained debug leveling, like glog or klog, too? Thanks, Mike --

[go-nuts] Re: Is Go good choice for porting graph based app?

2022-02-06 Thread Mike Schinkel
Kamil, Are the JSON files using a set schema, or could they be any arbitrary schema? Not that the latter can't be handled by Go, but IMO Go excels at the former because of ability to statically type. -Mike On Sunday, February 6, 2022 at 6:15:25 AM UTC-5 kziem...@gmail.com wrote: &g

[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

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

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

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] 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

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

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

[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

[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

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

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

[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

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

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

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.

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

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

[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

[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

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: 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: 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

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] 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] 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] 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] 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-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

[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] 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: 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] 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

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] 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] 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-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] 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] 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
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
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-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] 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] 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] 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
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
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-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

  1   2   >