HackerTrans
TopNewTrendsCommentsPastAskShowJobs

jub0bs

no profile record

Submissions

[untitled]

1 points·by jub0bs·geçen yıl·0 comments

[untitled]

1 points·by jub0bs·geçen yıl·0 comments

[untitled]

1 points·by jub0bs·2 yıl önce·0 comments

Jub0bs/CORS: a better CORS middleware library for Go

jub0bs.com
1 points·by jub0bs·2 yıl önce·1 comments

comments

jub0bs
·geçen yıl·discuss
"Stateless" does not seem as strong as "pure", and purity is what I'm after. What about an iterator that maintains no state but prints to the screen? You could describe it as a "stateless", but not as "pure".
jub0bs
·geçen yıl·discuss
Ok, that is annoying. I hope it gets fixed soon.
jub0bs
·geçen yıl·discuss
Your post does show that iterators are somewhat of a leaky abstraction, but I'm not sure I would go as far as calling some of their infelicities "bugs". Whether those infelicities matter in practice is a moot point.
jub0bs
·geçen yıl·discuss
Instead of recovering from what clearly is a bug, why not fix that bug instead?
jub0bs
·geçen yıl·discuss
There are even panics that are intended as irrecoverable: https://cs.opensource.google/go/x/sync/+/refs/tags/v0.12.0:s...
jub0bs
·geçen yıl·discuss
I don't think any reasonable member of the Go community would claim that any aspect of the language and its standard library is perfect. The many open issues on https://github.com/golang/go attest to that.

One example, if I may: the errors.As function is far from ergonomic. It would have been much better if generics had come to the language before that function was added to the standard library. Modern alternatives exist: https://pkg.go.dev/github.com/jub0bs/errutil
jub0bs
·geçen yıl·discuss
One data point showing that Pike's views can be and sometimes are controverted: https://www.youtube.com/watch?v=5uM6z7RnReE&t=18m
jub0bs
·geçen yıl·discuss
> actually they always intended to have generics

There was a time when generics were not even on the table. I'm pretty sure I remember an old talk by Rob Pike where he says that much.

People can change their mind as they learn more about the problem space; that should be tolerable.
jub0bs
·2 yıl önce·discuss
[dead]
jub0bs
·2 yıl önce·discuss
You cannot use `Access-Control-Allow-Origin: *` indiscriminately, though. In some cases, it can be dangerous: https://security.stackexchange.com/questions/227779/concrete...
jub0bs
·2 yıl önce·discuss
I’ve just released jub0bs/cors, a new CORS middleware library for Go, perhaps the best one yet. It has some advantages over the more popular rs/cors library, including a simpler API, better documentation, extensive configuration validation, a useful debug mode, stronger performance guarantees.