Re: [go-nuts] Prefer named variables or "with" in templates?

2025-05-27 Thread Kevin Chowski
Note that these samples are not semantically equivalent, so that may factor into the choice between the two for more complex examples. While using 'with', if the pipeline value comes out "empty" then the entire 'with' block is skipped. That may have implications in both the short and long term

[go-nuts] Re: Implementing Server-Sent Events (SSE)

2025-04-23 Thread Kevin Chowski
It would be nice to see an example of how to utilize this from the browser rather than curl, e.g. some JavaScript client code. On Wednesday, April 23, 2025 at 10:49:27 AM UTC-6 Cheikh Seck wrote: > Hi folks, I wanted to share a post I recently wrote that provides an > overview of what SSE is an

[go-nuts] Re: Why is go vet slow

2024-10-01 Thread Kevin Chowski
Have you tried running it under strace or another tool which gives you insights about a running program?? On Monday, September 30, 2024 at 1:48:53 PM UTC-6 Amnon wrote: > go vet ./... has recently become very slow on my company's code-base > taking 20s to complete. > > Is there an easy way I can

[go-nuts] Re: Can we suggest to the GC that I think this memory can be reclaimed?

2024-09-16 Thread Kevin Chowski
In particular, since Go has a goal of avoiding use-after-free bugs, the GC would have to do the same validation it is doing anyway to double-check that the caller is not wrong. On Saturday, September 14, 2024 at 10:55:49 AM UTC-6 Frederik Zipp wrote: > Yes, by no longer holding a reference to i

Re: [go-nuts] Re: raw bit types without arithmetic

2024-05-15 Thread 'Kevin Chowski' via golang-nuts
he only benefit of these types. > > † except for shifts, those would have to deal with carries. That may > be a problem, but I think even then it should be fast enough to not be > an issue the way faking div or something very expensive like that > would be. > > On Mon,

[go-nuts] Re: raw bit types without arithmetic

2024-05-13 Thread Kevin Chowski
out these extra types, if such optimizations just worked on byte arrays in general. On Monday, May 13, 2024 at 9:38:36 PM UTC-6 Kevin Chowski wrote: > How about just allowing bitwise operations on byte arrays (of the same > length)? > > On Monday, May 13, 2024 at 2:51:19 PM UTC-6 jimmy

[go-nuts] Re: raw bit types without arithmetic

2024-05-13 Thread Kevin Chowski
How about just allowing bitwise operations on byte arrays (of the same length)? On Monday, May 13, 2024 at 2:51:19 PM UTC-6 jimmy frasche wrote: > I'm not 100% sure if this is a good idea but it's been knocking around > in my head all week so I thought I'd share in case it has any merit: > > Int

Re: [go-nuts] generics question

2024-05-03 Thread 'Kevin Chowski' via golang-nuts
Sorry for the noise - looks like you meant when passing around objects by this type, not just creating objects. On Friday, May 3, 2024 at 11:02:37 AM UTC-6 Kevin Chowski wrote: > If you are just unhappy about the A and A* while using a literal for C: > note that if you are willing/a

Re: [go-nuts] generics question

2024-05-03 Thread 'Kevin Chowski' via golang-nuts
If you are just unhappy about the A and A* while using a literal for C: note that if you are willing/able to write a wrapper function instead of using a literal, type inference works well today: func NewC[E any, P Settable[E]](val []E) C[E, P] { return C[E, P]{Val: val} } var c = NewC([]A{1, 2,

Re: [go-nuts] Is it possible to "extract" the generic [T] from a reflected type ?

2024-04-17 Thread 'Kevin Chowski' via golang-nuts
If I understand correctly, the restriction is that the compiler has to know all possible instantiations of a generic func/type/etc at compile time. So listing out each specific Hello instantiation is the workaround, which allows you to approximate this if you have a closed set of types you want

Re: [go-nuts] Re: Changing PWD ruins test caching

2024-02-08 Thread Kevin Burke
41e0c => > input ID 8671bffc7a3ec5201bb26a0eccecb5599259f0d0e63624375378b61cc00a0733 > => 516ef3f5e0d83ea893583f43f60e654775b3769b5f99f2de7b99487eae637298 > ok example (cached) > > > - sean > > On Thu, Feb 8, 2024 at 12:13 AM Kevin Burke wrote: > > > > S

Re: [go-nuts] Re: Changing PWD ruins test caching

2024-02-07 Thread Kevin Burke
s to `os.Chdir` result in a spurious > dependency on the PWD variable: > > https://cs.opensource.google/go/go/+/master:src/os/file.go;l=340-345;drc=d961b12be9001cf8dbf8f52847607dbf84d94f8d > > On Thursday, November 23, 2023 at 1:50:04 PM UTC-5 Kevin Burke wrote: > >> We ha

[go-nuts] Re: Getting panic: proto: extension number 1042 is already registered on message google.protobuf.FileOptions

2023-12-26 Thread Kevin Chowski
Please provide some more information about what you are trying to do, and how to reproduce your problem from scratch. Otherwise it will be hard to provide you any help at all. For example, what code are you using? What commands are you running? What goal are you trying to accomplish in the firs

[go-nuts] gomobile/gobind failing to build a library with interface argument

2023-11-28 Thread Kevin Wang
I'm trying to build https://github.com/pion/webrtc with gomobile but I'm running into this error. To reproduce, clone and then run gomobile bind . gobind/go_webrtcmain.go:86:19: cannot use (*proxywebrtc_TrackLocal)(_param_track_ref) (value of type *proxywebrtc_TrackLocal) as webrtc.TrackLocal v

[go-nuts] Re: Why does my time.Ticker work fine for 6 months then suddenly stop sending ticks?

2023-11-26 Thread Kevin Chowski
Perhaps I'm missing something, but given that 1.21.4 was released 2023-11-07 I'm not sure how it could have been running for 6 months. Do you mind double-checking your assumptions? On Sunday, November 26, 2023 at 4:59:10 PM UTC-5 Ari Croock wrote: > Hi, > > I hope someone here can shed some lig

[go-nuts] Re: Changing PWD ruins test caching

2023-11-25 Thread Kevin Chowski
ually running, and briefly looking through the code it seems that the PWD variable is only used it if actually matches "." Sorry for the noise if this isn't helpful - I'm on mobile so I can't test right now. On Thursday, November 23, 2023 at 1:50:04 PM UTC-5 Kevin Burk

[go-nuts] Changing PWD ruins test caching

2023-11-23 Thread Kevin Burke
We have some tests that are pretty slow. I would like to use Go's test caching to skip them in our CI environment, if nothing in the code or the environment has changed. Our CI environment has a set of _agents_, each of which can run multiple jobs simultaneously. As a result, they check out cod

Re: [go-nuts] go.mod go directive coverage of stdlib contract?

2023-11-06 Thread 'Kevin Gillette' via golang-nuts
Thanks! This is a pitfall that doesn't come up often, but would arise when "polyfilling" later behavior into an earlier version, in conjunction with version build tags. It's something I'll need to keep in mind in the future. -- Kevin On Saturday, November 4, 2023 a

[go-nuts] go.mod go directive coverage of stdlib contract?

2023-11-04 Thread 'Kevin Gillette' via golang-nuts
rationale about this contract covering the language, but not the stdlib? Thanks! Kevin Gillette -- 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

[go-nuts] Clarification on the Compatibility Promise regarding Version Build Constraints

2023-10-22 Thread Kevin Gillette
g the toolchain), and if it's already not documented somewhere I failed to find, then it would be a caveat to the compatibility promise that is probably worth explicitly spelling out. Thank you! Kevin Gillette -- You received this message because you are subscribed to the Google Groups &q

[go-nuts] Re: Memoization and Value types

2023-03-27 Thread Kevin Chowski
If you are willing to include some global state to your package, you could always have memoizing logic occur outside of the Number type. That is - you could still have every Number be passed around by value, but for calculating sqrt you'd check some threadsafe global state and either return a p

Re: [go-nuts] Guaranteeing deterministic execution of Golang code

2023-01-15 Thread Kevin Chowski
Sorry, I should have read Axel's blogpost before posting. I enjoyed reading it, thanks for sharing :) some of what I was talking about is covered with more code examples in the post. On Sunday, January 15, 2023 at 1:03:50 PM UTC-7 Kevin Chowski wrote: > I think a little more backgrou

Re: [go-nuts] Guaranteeing deterministic execution of Golang code

2023-01-15 Thread Kevin Chowski
may not be an observable effect in your average program, so I don't know if you consider this aspect important. -Kevin On Saturday, January 14, 2023 at 4:38:18 PM UTC-7 axel.wa...@googlemail.com wrote: > Oh, also, fmt: https://go.dev/play/p/xxOw3vqWR4u (probably need to run > this off

Re: [go-nuts] WebAssembly and Filesystem access

2022-12-16 Thread 'Kevin Chowski' via golang-nuts
Fri, Nov 04, 2022 at 02:08:08PM -0700, 'Kevin Chowski' via golang-nuts > wrote: > > [...] > > I am on a project which primarily ships a Go command line interface > (CLI), > > but we have aspirations of using the wasm compilation mode to also > > dist

Re: [go-nuts] Re: Why not tuples?

2022-12-04 Thread Kevin Chowski
If you really need anonymous tuple types that support decoding that sort of JSON, it isn't too hard to write one: https://go.dev/play/p/Fn_wUXh2drs Go's generics don't support varargs types (...yet? who knows) so there'd be a little copypasta if you needed many different tuple lengths, but Java

[go-nuts] WebAssembly and Filesystem access

2022-11-04 Thread 'Kevin Chowski' via golang-nuts
solve all of my problems without having to change any code on my end, which would be nice. In lieu of that, does anyone have any tips about how I could go about doing this in a better way? -Kevin -- You received this message because you are subscribed to the Google Groups "golang-nuts&qu

[go-nuts] Re: Error-checking with errors.As() is brittle with regards to plain vs pointer types

2022-09-22 Thread 'Kevin Chowski' via golang-nuts
If some func advertises the type of error it returns, it should mention the precise type. That is, if a function returns *ABC in error conditions, it should document that it returns *ABC (not ABC, that is a different type). Why is that no sufficient? An API already must document the type of erro

[go-nuts] A pedantic question about updating a map during iteration

2022-08-02 Thread Kevin Chowski
Apologies if I just missed some other part of the spec that ensures this. Thanks in advance for your time, Kevin -- 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] noinline is 25% faster than inline on apple m1 ?

2022-07-22 Thread Kevin Chowski
code, though I didn't double-check): https://go.dev/play/p/h1K38Bq7Otv On Friday, July 22, 2022 at 7:56:54 PM UTC-6 Kevin Chowski wrote: > Datapoint: same with windows/amd64 on Intel (running 1.19beta1): > > goos: windows > goarch: amd64 > pkg: common/sandbox > cpu: In

Re: [go-nuts] noinline is 25% faster than inline on apple m1 ?

2022-07-22 Thread Kevin Chowski
Datapoint: same with windows/amd64 on Intel (running 1.19beta1): goos: windows goarch: amd64 pkg: common/sandbox cpu: Intel(R) Core(TM) i7-6650U CPU @ 2.20GHz BenchmarkNoInline-4 7742584814.34 ns/op BenchmarkInline-4 5910893220.58 ns/op PASS ok common

[go-nuts] Re: Can't read >32KBytes from http response body.

2022-06-22 Thread Kevin Chowski
Do you have a self-contained reproducer? E.g., a single Go program that hosts a server (either using the server functionality from package net/http, or hard-coded HTTP responses) and shows that using the client logic in net/http causes this problem? Preferably shared via play.golang.org link. I

Re: [go-nuts] Help with sync.Cond failing to signal

2022-06-14 Thread Kevin Burke
n of events >>> >>> See also: https://github.com/golang/go/issues/21165 >>> > On top of that, condition variables are fiendishly difficult to use: >>> they are prone to either missed or spurious signals [citation needed] >>> >>> - sean >&g

Re: [go-nuts] Help with sync.Cond failing to signal

2022-06-11 Thread Kevin Burke
nto writeEvent, > essentially a proper serialization of events > > See also: https://github.com/golang/go/issues/21165 > > On top of that, condition variables are fiendishly difficult to use: > they are prone to either missed or spurious signals [citation needed] > > - sean &

[go-nuts] Help with sync.Cond failing to signal

2022-06-11 Thread Kevin Burke
thread that is calling Signal() holds the lock? Thanks for your help, Kevin -- 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+unsubsc

[go-nuts] A cloud-native Go microservices framework with cli tool for productivity.

2022-05-30 Thread Kevin Wan
https://github.com/zeromicro/go-zero go-zero (listed in CNCF Landscape: https://landscape.cncf.io/?selected=go-zero) is a web and RPC framework with lots of builtin engineering practices. It’s born to ensure the stability of the busy services with resilience design and has been serving sites w

[go-nuts] Re: Better replacement for strings.Title?

2022-03-30 Thread 'Kevin Chowski' via golang-nuts
Someone replied off-list and suggested using the cases.NoLower option while initializing the Caser. And it worked! Thanks! On Wednesday, March 30, 2022 at 10:15:40 AM UTC-6 Kevin Chowski wrote: > I guess "Better" is not really what I mean... maybe more accurately I need > somet

[go-nuts] Re: Better replacement for strings.Title?

2022-03-30 Thread 'Kevin Chowski' via golang-nuts
I guess "Better" is not really what I mean... maybe more accurately I need something "closer" to strings.Title. On Wednesday, March 30, 2022 at 9:59:24 AM UTC-6 Kevin Chowski wrote: > strings.Title is newly deprecated > <https://tip.golang.org/doc/go1.18#:~:t

[go-nuts] Better replacement for strings.Title?

2022-03-30 Thread &#x27;Kevin Chowski' via golang-nuts
rk. Will I have to just keep using this old version, or is there a way to get the new library working the way I need it to work? Thanks again in advance for the advice, Kevin -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsu

[go-nuts] Re: Goroutines - handles, signals, and signal handlers

2022-03-21 Thread &#x27;Kevin Chowski' via golang-nuts
In Go, goroutines are meant to explicitly signal each other; further, it seems very intentional that goroutines are never interrupted in the middle of execution like an interrupt service routine might in a lower-level situation. It was mentioned in a prior message a bit, but to add more details

Re: [go-nuts] are Go generics more like C++ or more like Java?

2022-02-27 Thread Kevin Chowski
I think it would be neat for the Go compiler to natively support profiles for profile-guided optimization to help make decisions about code generation for generics (and specialization for interfaces, for that matter). And also other ra

Re: [go-nuts] Re: Should dev tools be tracked by go.mod?

2022-01-24 Thread Kevin Wan
I'm separating go.mod files for framework and cli tool in our project . It works well. On Tuesday, January 25, 2022 at 5:45:29 AM UTC+8 sv...@redhat.com wrote: > Hi Sean, > > Thanks a lot for your answer! > > On Mon, Jan 24, 2022 at 9:01 PM Sean Liao wrote:

[go-nuts] A microservice framework built for development productivity.

2022-01-18 Thread Kevin Wan
go-zero (listed in CNCF Landscape: https://landscape.cncf.io/?selected=go-zero) is a web and rpc framework with lots of builtin engineering practices. It’s born to ensure the stability of the busy services with resilience design, and has been serving sites with tens of millions users for year

Re: [go-nuts] Convert a go.mod file into checked out dependencies

2022-01-12 Thread Kevin Burke
Ah, yes, that would work but wouldn't include the git history... On Wednesday, January 12, 2022 at 12:28:49 PM UTC-8 robert...@gmail.com wrote: > https://go.dev/ref/mod#go-mod-vendor > > On Wed, Jan 12, 2022 at 10:58 AM Kevin Burke wrote: > >> Hi, >> Sometimes

[go-nuts] Convert a go.mod file into checked out dependencies

2022-01-12 Thread Kevin Burke
exist? Failing that, is there a tool that will read a go.mod file and give me version information about each dependency? I see packages.Load, but that doesn't seem super targeted for the use case; if it's the best that exists then I'll probably make it work. Kevin -- You received

Re: [go-nuts] go1.18 beta1: method instantiation accepts builtin types

2021-12-25 Thread Kevin Chowski
Sorry, I meant "prevent people from doing silly things" On Saturday, December 25, 2021 at 7:37:19 PM UTC-7 Kevin Chowski wrote: > As Brian alludes to, note that Go lets you redefine many (maybe all?) > identifiers that are defined in the "universe" block: > http

Re: [go-nuts] go1.18 beta1: method instantiation accepts builtin types

2021-12-25 Thread Kevin Chowski
As Brian alludes to, note that Go lets you redefine many (maybe all?) identifiers that are defined in the "universe" block: https://go.dev/play/p/qbF94AG-VbA Code review is a wonderful tool to avoid people from doing silly things like that in a codebase! On Thursday, December 16, 2021 at 3:08:

Re: [go-nuts] Re: Q about defer

2021-12-24 Thread Kevin Malachowski
021, 12:50 PM Kevin Chowski wrote: > Specifically, this part from the #Defer_statements linked by Peter: > > "For instance, if the deferred function is a function literal and the > surrounding function has named result parameters that are in scope within > the literal, the de

[go-nuts] Re: Q about defer

2021-12-24 Thread Kevin Chowski
Specifically, this part from the #Defer_statements linked by Peter: "For instance, if the deferred function is a function literal and the surrounding function has named result parameters that are in scope within the literal, the deferred function may access and modify the result parameters befo

[go-nuts] Re: about for range with array?

2021-12-24 Thread Kevin Chowski
Comments inline below: On Friday, December 24, 2021 at 10:08:23 AM UTC-7 cuiw...@gmail.com wrote: > in the lang spec , it says: > *The range expression x is evaluated once before beginning the loop, with > one exception: if at most one iteration variable i

Re: [go-nuts] Maps with non-comparable keys

2021-12-23 Thread Kevin Chowski
I tried my hand at it for fun :) it is a linear probed hashmap based on uint64 map keys: https://gotipplay.golang.org/p/gzrbS-B6ixg I claim no rights nor responsibility for the above example; it only took me like 20 minutes and has extremely minimal testing; it may contain bugs. Use at your own

[go-nuts] Re: Alternatives to wrapping errors

2021-12-23 Thread Kevin Chowski
Have you seen https://go.dev/blog/go1.13-errors? If one wants to use error unwrapping, these days generally it is suggested to use the functionality from the standard package "errors" (or fmt.Errorf) rather than some third-party package. That way everyone does it the same way, making third-part

[go-nuts] Re: Golang JSONObject

2021-12-23 Thread Kevin Chowski
This is not a real "why", but this how json.Marshal works according to the documentation. From https://pkg.go.dev/encoding/json#Marshal: "Struct values encode as JSON objects. Each exported struct field becomes a member of the object, using the field name as the object key, unless the field is

[go-nuts] Re: httptest and gorilla/mux route variables

2021-12-03 Thread Kevin Mathew S
This works perfectly for me func newReq(method, path, body string, vars map[string]string) *http.Request { r := httptest.NewRequest(method, path, strings.NewReader(body)) return mux.SetURLVars(r, vars) } On Tuesday, May 12, 2015 at 7:34:21 PM UTC+5:30 al...@getloopd.com wrote: > Awesome! This

[go-nuts] Re: Trouble exporting function with anonymous struct containing anonymous fields as parameter

2021-11-16 Thread &#x27;Kevin Chowski' via golang-nuts
Sorry, I included a typo. I have edited my reply below to fix it. On Tuesday, November 16, 2021 at 8:25:47 PM UTC-7 Kevin Chowski wrote: > It's not clear to me what problem you are solving. Can you clarify *why* > you want to do this? > > For what it's worth, this

[go-nuts] Re: Trouble exporting function with anonymous struct containing anonymous fields as parameter

2021-11-16 Thread &#x27;Kevin Chowski' via golang-nuts
It's not clear to me what problem you are solving. Can you clarify *why* you want to do this? For what it's worth, this seems correct to me: a function defined in package X should not be able to access the unexported fields of a struct in package Y. If you embed a 'byte' into a struct, that is

Re: [go-nuts] Go http/2 implementation is x5 less per performant than http/1.1

2021-11-15 Thread Kevin Chowski
These are interesting results, thanks for investigating and sharing results! I see that you have mostly been focusing on throughput in your posts, have you done testing for latency differences too? On Saturday, November 13, 2021 at 6:11:40 PM UTC-7 ren...@ix.netcom.com wrote: > As another data

[go-nuts] Re: Logging libraries and standard library compatibility

2021-08-30 Thread Kevin Chowski
Can you clarify why having log.Logger be an interface would be helpful? Any library can define their own Logger interface with the same methods as the log.Logger type (e.g. Printf, Fatalf), and that would allow that library to take a reference to some generic "logging implementation" without be

[go-nuts] Re: Best web framework ?

2021-08-01 Thread Kevin Powick
It depends on your use-case. Many developers find the standard Go library good enough. However, I believe several developer surveys show Gin, Echo, and Beego as the top 3. -- Kevin Powick On Sunday, 1 August 2021 at 13:45:50 UTC-4 sdkm...@gmail.com wrote: > Hi ! > > which web fra

Re: [go-nuts] Go and GPUs

2021-06-27 Thread Kevin Chadwick
Didn't AMD and Intel open source their drivers. Or are you talking about firmware here? I thought that is how OpenBSD can run well with them but not with Nvidia hw? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group a

Re: [go-nuts] Modules... why it has to be so painfull?

2021-04-08 Thread Kevin Chadwick
> >>One solution is apparently to use a module like a giant mono repo, aka > >>gopath> Still it requires for this replace You do not need replace, unless you are amalgamating multiple modules. You can just create a folder named e.g. library with a .go file; package lib Then in your other folder

Re: [go-nuts] Modules... why it has to be so painfull?

2021-04-07 Thread Kevin Chadwick
> > > https://golang.org/ref/mod The how to code docs need improving for packages but once you initialise a module. You can create folders to hold different packages within the root folder containing the .mod file. I'm not sure modules are not a regression compared to gopath in some respects thoug

Re: [go-nuts] I'm missing godoc for local packages after converting to modules.

2021-03-28 Thread Kevin Chadwick
I found you had to cd to each directory with a .mod file and run it there. A global option would be nice to know about. -- 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 emai

[go-nuts] Re: %v for []string{} and []string{""}

2021-03-18 Thread &#x27;Kevin Chowski' via golang-nuts
The "%#v" print verb is intended to be used for unambiguous printing of a type, but that means it will have a prefix of `[]string` in order to ensure the type is unambiguous. I personally use %q a lot any time I know I have a string (or set of strings) which might be ambiguous in some way, but I

Re: [go-nuts] Healthy tinygo Was: No generic, part -2

2021-03-17 Thread Kevin Chadwick
Thank You for answering Regards, kc -- 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

Re: [go-nuts] Healthy tinygo Was: No generic, part -2

2021-03-17 Thread Kevin Chadwick
On 3/17/21 1:57 PM, Axel Wagner wrote: > No, I am saying that your assumptions that generics pose a problem is wrong. > There is no technical reason that would prevent the authors of TinyGo to > implement them, without too much trouble. Certainly far less trouble than > other > language features t

Re: [go-nuts] Healthy tinygo Was: No generic, part -2

2021-03-17 Thread Kevin Chadwick
> I'm actually happiest with the language part of GO. Not necessarily so much, > the> implementation. It has the potential to make me happy, anyway.> > "https://tinygo.org/lang-support/stdlib/"; I should clarify. My interest is purely memory safety and ease of porting existing vendor provided C c

Re: [go-nuts] Healthy tinygo Was: No generic, part -2

2021-03-17 Thread Kevin Chadwick
On 3/17/21 10:02 AM, Axel Wagner wrote: > When I look at the Go language feature page of TinyGo > , I don't think that GC is the only or > largest > hindrance to using it with normal Go programs. TBQH I'm always surprised that > people call it a Go implementation

Re: [go-nuts] Healthy tinygo Was: No generic, part -2

2021-03-17 Thread Kevin Chadwick
On 3/17/21 12:11 PM, Space A. wrote: > I don't think Java failed on micros, for instance look at JavaCard, a lot of > SIM-cards are running applets based on it. SIM cards can be a dying technology > on itself, but still, I think there was a huge success. Not sure about other > "small places" becaus

[go-nuts] Healthy tinygo Was: No generic, part -2

2021-03-17 Thread Kevin Chadwick
>> Go will loose its uniqueness and values, will never become a next big >thing. No cross platform GUI, no Android, and browsers (GopherJS is >more dead than alive, WASM idk) is also a big question. It will be a >"bad copy" of Java or other mature languages (with better and more >powerful generics

Re: [go-nuts] Auto Make a named return map

2021-03-15 Thread Kevin Chadwick
On 3/13/21 5:27 PM, 'Axel Wagner' via golang-nuts wrote: >   > I'm once again not sure what your objective is here. No one is trying to argue > that it is impossible to introduce semantics like you propose. > We are only trying to give you the reasons why that's currently not done. > > You can al

Re: [go-nuts] Auto Make a named return map

2021-03-13 Thread Kevin Chadwick
On Sat, 13 Mar 2021, 17:00 Jan Mercl, <0xj...@gmail.com> wrote: > On Sat, Mar 13, 2021 at 5:52 PM Kevin Chadwick > wrote: > > > Very little resources, unless the map is actually used and not for long. > If you really need to control gos memory use, you need to preall

Re: [go-nuts] Auto Make a named return map

2021-03-13 Thread Kevin Chadwick
On Sat, 13 Mar 2021, 15:05 Jan Mercl, <0xj...@gmail.com> wrote: > On Fri, Mar 12, 2021 at 1:24 AM Kevin Chadwick > wrote: > > > Why doesn't go auto init or make an empty map for a named return to > avoid the potential chance of a panic due to operating on a nil ret

Re: [go-nuts] Auto Make a named return map

2021-03-13 Thread Kevin Chadwick
On 3/13/21 1:40 PM, Axel Wagner wrote: > > Compiler complication is not the concern. It would be easy to build any of the > suggested semantics into the language. It is just that none of the suggestions > so far seem clearly better - that is, they all come with their own downsides. > OK, I reall

Re: [go-nuts] Auto Make a named return map

2021-03-13 Thread Kevin Chadwick
> > I don't think we should change creation; what about having the first > insert > make the map if it's nil? > > It seems that would be fairly transparent. > This wouldn't solve the problem that I saw. Whilst, an easy personal fix is to make sure coders always make a map wheneve

Re: [go-nuts] Auto Make a named return map

2021-03-12 Thread Kevin Chadwick
>This sounds like if you are suggesting to make the zero value of a map >an >empty map, which is different from initializing a map variable to an >empty >map if it a named return. That suggestion has come up a lot, both on >this >list and on the github issue tracker. It's, unfortunately, not as e

Re: [go-nuts] Auto Make a named return map

2021-03-12 Thread Kevin Chadwick
On 3/12/21 12:33 PM, Axel Wagner wrote: > This sounds like if you are suggesting to make the zero value of a map an > empty > map, which is different from initializing a map variable to an empty map if > it a > named return. That suggestion has come up a lot, both on this list and on the > github

Re: [go-nuts] Auto Make a named return map

2021-03-12 Thread Kevin Chadwick
On 3/12/21 11:51 AM, Kevin Chadwick wrote: > Incidentally, I would be happy with err != "". Of course I do appreciate the wrapping/error testing. Though I use little/no more than could be accomplished with typed strings.Contains, personally. -- You received this message be

Re: [go-nuts] Auto Make a named return map

2021-03-12 Thread Kevin Chadwick
On 3/12/21 7:16 AM, Axel Wagner wrote: > I find named returns produce more readable code but I avoid them when > returning a map. > > > Personally, I would recommend avoiding naked returns in all cases. In the best > case, a naked return is less explicit and requires readers to think abou

[go-nuts] Auto Make a named return map

2021-03-11 Thread Kevin Chadwick
I find named returns produce more readable code but I avoid them when returning a map. Why doesn't go auto init or make an empty map for a named return to avoid the potential chance of a panic due to operating on a nil return? -- You received this message because you are subscribed to the Google

Re: [go-nuts] Re: Modules and gopls (in VSCode)

2021-03-08 Thread Kevin Chadwick
On 3/8/21 12:04 AM, 'Peter Bourgon' via golang-nuts wrote: > I don't have enough context about your development environment to say > you're using modules ·incorrectly·, but I'm fairly certain you're making > life significantly harder for yourself by trying to work with 137 (!) of > them at once.

Re: [go-nuts] Differences between go1.16 and go1.15 ?

2021-02-25 Thread Kevin Chadwick
On 2/25/21 8:31 AM, Brian Candler wrote: > I suggest that newcomers are told to create an empty directory, create main.go > in that directory, and then use "go run ." (a literal dot), "go build .", "go > fmt ." etc.  Of course, this means that if you have several programs you need > to > create se

Re: [go-nuts] Orderly exit

2021-02-24 Thread Kevin Chadwick
On February 24, 2021 11:37:05 PM UTC, robert engels wrote: >A simple slice OOB causes a panic - this is why many robust servers >will catch & recover so a single OOB due to bug triggered by rare >input/state doesn’t crash the server for 1000’s of users. It might >still cause problems due to resou

Re: [go-nuts] Orderly exit

2021-02-24 Thread Kevin Chadwick
On February 24, 2021 11:16:46 PM UTC, robert engels wrote: >I’m sorry but that is not correct. If you have a “server process” that >handles requests for 1000’s of clients - terminating the process due to >an exception/panic easily leads to a DoS attack. The bad actor only >needs to send similar r

Re: [go-nuts] Orderly exit

2021-02-24 Thread Kevin Chadwick
On February 24, 2021 8:00:36 PM UTC, Robert Engels wrote: >Depending on other infrastructure that can easily lead to easy DoS >attacks. Utter nonsense, more likely the opposite, if any difference at all. -- You received this message because you are subscribed to the Google Groups "golang-nut

Re: [go-nuts] Orderly exit

2021-02-24 Thread Kevin Chadwick
On 2/24/21 9:53 AM, roger peppe wrote: > On Tue, 23 Feb 2021 at 12:10, Kevin Chadwick <mailto:m8il1i...@gmail.com>> wrote: > > I only instigate panic manually for one thing. Perhaps that will change, > but > I doubt it. > > If I want to send out or w

Re: [go-nuts] Why can net.Dial be very slow on a hostname defined in /etc/hosts?

2021-02-23 Thread Kevin Chadwick
On February 23, 2021 2:46:20 PM UTC, Robert Engels wrote: >I am not 100% certain but the build statement at the top of the Unix >dns client specified Darwin. I would read the Go issues I linked to in >the code snippet. I believe it varies. Android has no universal textual interface - /etc/reso

Re: [go-nuts] Why can net.Dial be very slow on a hostname defined in /etc/hosts?

2021-02-23 Thread Kevin Chadwick
On February 23, 2021 1:57:07 PM UTC, Peng Yu wrote: >This does not answer the question why net.Dial can not be made with >the same behavior as ping on MacOSX. If the C library behaves >differently on MacOSX and Linux, then the C library should not be >relied on in this case. I just want to use /et

Re: [go-nuts] Orderly exit

2021-02-23 Thread Kevin Chadwick
> So you should probably disregard the sentinel-panic idea, > runtime.Goexit seems strictly superior) Thank you. I shall look into those. WRT Goexit. I was hoping a defer in main would run also. Thinking about it. I shall have to ponder about the relationship of panic and process groups too

[go-nuts] Orderly exit

2021-02-23 Thread Kevin Chadwick
I only instigate panic manually for one thing. Perhaps that will change, but I doubt it. If I want to send out or write a log to disk then I will call panic rather than os.exit, upon a log.fatal scenario. Think buffered go routine logging. Saving the coder from having to think about it, once in

Re: [go-nuts] Error handling

2021-02-18 Thread Kevin Chadwick
>don’t think ‘single shot, short lived processes’ are the typical Go >paradigm - they are usually larger , multi layer, long lived “server” >processes. It’s my opinion that Gos error handling is a problem for >these types. I am not saying it can’t be done but it’s harder to >design/deliver/mainta

Re: [go-nuts] Error handling

2021-02-18 Thread Kevin Chadwick
On 2/18/21 4:01 AM, robert engels wrote: > But - the issue is that most of the time - for complex systems - the errors > cannot be handled where they are encountered - even in Go, most of the error > handling becomes boilerplate returning the error detected and expecting some > higher level to hand

[go-nuts] Re: embed.FS and memory limitations

2021-02-16 Thread &#x27;Kevin Chowski' via golang-nuts
If you had a simple test program or microbenchmark which put some numbers behind your concerns, I think you'll get a bit more traction. Have you tried to measure the effect of page faults on reading data from embedded files (or, I guess, any sort of data that has fallen out of the pagecache)? I

Re: [go-nuts] Re: How to get VSCode to use different Go env vars for different directories in the same repo?

2021-02-14 Thread Kevin Chadwick
> In future, work in two instances of VS Code I set GOOS env variable and HISTFILE env variable on each code execution. So a particular folder is tied to that OS and the terminal history is separate. IOW, i make a code app icon for each current project. One also for go stdlib src searches. --

Re: [go-nuts] Go Create

2021-02-08 Thread Kevin Chadwick
I am surprised this did not come up in the thread. I'm not sure if I never knew this was possible or I have forgotten during my time using replace. Turns out, that you can import a folder within the same module folder as mod identifier/package and it is automatically imported by gopls when you r

Re: [go-nuts] Possible Go 2 proposal for built-in Remove method for Slices.

2021-02-06 Thread Kevin Chadwick
>> > >> > A "remove element from _slice_" operation always must make a new >array >> > and copy all elements that you intend to stay. Current idiom using >append >> > will do this for you while being frank about costs. >> >> Maybe I misunderstand what you wrote, but as long as the slice has >> enou

Re: [go-nuts] Go Create

2021-02-03 Thread Kevin Chadwick
On 2/3/21 5:14 PM, Kevin Chadwick wrote: > Why would I trust DNS > Why would I setup letsencrypt > What if we have a minimal internet use developer machine policy https://roberto.selbach.ca/go-proxies Oh, this will be annoying. https://golang.org/ref/mod#module-proxy A module p

Re: [go-nuts] Go Create

2021-02-03 Thread Kevin Chadwick
On 2/3/21 2:46 PM, David Riley wrote: > I understand the need for the domain as part of the module namespacing, but > it does make a certain assumption that all of these things are going to be on > resolvable domains, which isn't true for everyone. I have a resolvable domain and run a mail serve

Re: [go-nuts] Go Create

2021-02-02 Thread Kevin Chadwick
> >> Note, that this is essentially one of the workflows suggested here (which I >> would consider the canonical documentation for the "eng org wants to onboard >> Go" case): >> https://golang.org/ref/mod#private-modules > > I have realised a goproxy may be needed rather than a http server as I e

[go-nuts] Options other than pointers, regarding code duplication

2021-01-28 Thread Kevin Chadwick
I have three logging functions that are almost identical. If I move the identicle code into a function without pointers then there is a noticeable speed decrease. I know this is premature optimisation as logging shouldn't happen frequently enough or be that large (hopefully). That said. I am left

Re: [go-nuts] Go Create

2021-01-27 Thread Kevin Chadwick
> Note, that this is essentially one of the workflows suggested here (which I > would consider the canonical documentation for the "eng org wants to onboard > Go" case): > https://golang.org/ref/mod#private-modules I have realised a goproxy may be needed rather than a http server as I expect a d

  1   2   3   4   >