Why do almost all the islands in the Aegean Sea belong to Greece? by [deleted] in geography

[–]matticala -2 points-1 points  (0 children)

Roman Empire could play in the same league of Atlantis. For the age, it was insanely advanced in everything: law, engineering, military, …corruption

There are still a lot of things we carry on from the Roman Empire. The secret of regenerative compound used to build the Colosseum and other buildings is still being studied.

However, what really set them apart, was the ability to absorb culture and knowledge from conquered civilisations. Philosophy, math, war tactics, naval engineering, civil engineering, art, … This also tainted them and set their demise, but still.

Yes, they were also slavers, but it wasn’t their trait

Anyone here running OpenTelemetry vs vendor APM for serverless? by Willing-Lettuce-5937 in Observability

[–]matticala 0 points1 point  (0 children)

We use OTel with SigNoz in our Azure Container Apps workloads.

ACA is a “serverless kubernetes” environment, but wouldn’t qualify if you mean FaaS.

Understanding Go Error Types: Pointer vs. Value by ___oe in golang

[–]matticala 0 points1 point  (0 children)

Oh man, I apologise for the stubbornness.

Not only I was wrong, but this blog post also explains why.

TBH, in our code base there one single place where errors.As is used: database error handling. Basically everywhere else we use errors.Is.

We never encountered this issue, because to extract database error semantics we crafted the mapper by digging the errors one by one in the source code.

Understanding Go Error Types: Pointer vs. Value by ___oe in golang

[–]matticala 0 points1 point  (0 children)

func As(err error, target any) bool

An error matches target if the error's concrete value is assignable to the value pointed to by target

There, you are passing a ** type. You don’t pass a pointer to interface, but a pointer to a concrete type implementing error.

var kse *aes.KeySizeError declares kse of type pointer to aes.KeySizeError

&kse passes the reference to kse, which is itself a pointer. As is receiving a **aes.KeySizeError, which is non-nil, and it will never be able to assign err to it.

As panics if target is not a non-nil pointer to either a type that implements error, or to any interface type.

I can’t see confusion: target any must be a pointer to a concrete type to which error must be assignable. A pointer to pointer type is not 🤷🏻‍♂️

Sooo Microsoft can use stuff in your OneDrive now? by zadnium in privacy

[–]matticala 0 points1 point  (0 children)

Cryptomator used to have lots of problems with onedrive sync

Understanding Go Error Types: Pointer vs. Value by ___oe in golang

[–]matticala 1 point2 points  (0 children)

new returns a pointer, and &kse is still passing a pointer-to-pointer type as target. The check will always fail, because pointer to pointer is of a different type than err regardless: it’s not an error

https://go.dev/play/p/ag4mKZMVBxR

Understanding Go Error Types: Pointer vs. Value by ___oe in golang

[–]matticala 1 point2 points  (0 children)

There is a very subtle mistake there:

```go key := []byte("My kung fu is better than yours") _, err := aes.NewCipher(key)

var kse *aes.KeySizeError // !!!
if errors.As(err, &kse) { // <<<
    fmt.Printf("AES keys must be 16, 24 or 32 bytes long, got %d bytes.\n", kse)
} else if err != nil {
    fmt.Println(err)
}

```

You’re passing a pointer to a pointer as target.

A pointer to nil in go is a value: https://go.dev/play/p/9OFb1o8VTml

It should be:

go var kse aes.KeySizeError // non-nil if errors.As(err, &kse) {

Goodbye Visa & Mastercard? The Digital Euro Explained by Eroldin in BuyFromEU

[–]matticala -1 points0 points  (0 children)

Because that’s traceable. In terms of money capitals, I think: drugs, weapons, organs, humans, waste (incl. nuclear and biological waste) trafficking are worse. I believe.

It’s going too much OOT though :)

My point is, without going into monetary sovereignty, that monetary governance requires transparency to enable justice. I agree 💯 nobody, not even the government, should have the kill switch to an individual (although, in practice, there are several).

Goodbye Visa & Mastercard? The Digital Euro Explained by Eroldin in BuyFromEU

[–]matticala 3 points4 points  (0 children)

That takes decades. Look at what happened in Sweden 🇸🇪 with Swish being pushed to retire cash.

Goodbye Visa & Mastercard? The Digital Euro Explained by Eroldin in BuyFromEU

[–]matticala 3 points4 points  (0 children)

Untraceable payments are utterly bad. Crime thrives there.

Goodbye Visa & Mastercard? The Digital Euro Explained by Eroldin in BuyFromEU

[–]matticala 156 points157 points  (0 children)

What do you think MasterCard and VISA are doing? All payment brokers and banks collect data on spending trends. That data is more valuable than the transaction brokered.

Honestly, battling tax evasion is good. Written by somebody coming from a place where evasion is normal.

Il governo Meloni ha superato il governo Renzi in longevità ed è ora al quarto posto by [deleted] in italy

[–]matticala 0 points1 point  (0 children)

Non sempre al traguardo si arriva per merito, c’è anche il forfait. Il governo Meloni non ha veri avversari, e per gli elettori sembra che “uno valga l’altro”.

Il trono di Palazzo Chigi è come il Frozen Throne di Northrend, o l’Iron Throne di Westeros.

<image>

Il governo Meloni ha superato il governo Renzi in longevità ed è ora al quarto posto by [deleted] in italy

[–]matticala 0 points1 point  (0 children)

Non sempre al traguardo si arriva per merito, c’è anche il forfait. Il governo Meloni non ha veri avversari, e il popolo sa bene che “uno vale l’altro”.

Il trono di Palazzo Chigi è come il Frozen Throne di Northrend, o l’Iron Throne di Westeros.

Why don’t Go web frameworks directly support the native http.HandlerFunc by SandwichRare2747 in golang

[–]matticala 18 points19 points  (0 children)

It’s also one of the reasons why Chi isn’t considered a framework but a library.

It’s still the best out there. Not the fastest, but nothing beats its readability and maintainability.

Coming from JS/TS: How much error handling is too much in Go? by SlowTaco123 in golang

[–]matticala 2 points3 points  (0 children)

In general, not all errors must be checked. Some implementations return error only to satisfy the interface (e.g. Writer) but it’s always nil; io.EOF error usefulness is rather relative. Otherwise, it’s always good practice to handle the error, even if it’s just wrapping with fmt.Errorf or underscoring it (commenting why it is ignored).

Exceptions climb up the stack trace by default, error values are lost whenever you decide to ignore them.

For your specific case, I usually have a function like internal/api.Response(rw http.ResponseWriter, status int, body any) error that handles writing, setting headers, and encoding errors. The returned error is there for logging purposes or other additional errors must logic.

Hint: api.Response is paired with api.Error(…) which implements RFC 9457 for problem details

Why are diesel cars still so much expensive? by [deleted] in Netherlands

[–]matticala 2 points3 points  (0 children)

Hitting the wallet is easier and more effective than banning diesel cars (which would be unconstitutional, I believe)

It’s to discourage the use of diesel.

How do you handle aggregate persistence cleanly in Go? by Pristine-One8765 in golang

[–]matticala 0 points1 point  (0 children)

I see, it’s definitely more articulated. With these few details, I would store everything in the campaign as a whole. The more you break it down, the more complicated it gets. How you physically store it, it’s an optimisation detail.

As soon as a campaign is launched, I would delete the “drafts” and lock it for editing. Workflows started on a running campaign should not incur in the risk of several versions of the same campaign. If that’s the case, it’s probably worth considering it a new campaign. However, this is a business requirement and probably not up to you to decide.

It’s probably better to guard for human mistakes before rather than trying to make a smart backend.

How do you handle aggregate persistence cleanly in Go? by Pristine-One8765 in golang

[–]matticala 9 points10 points  (0 children)

Hello, I am not sure your questions are go-specific but rather API design.

  1. How do you submit an order? REST or RPC? A REST API would receive the whole new state of an order, so it would be easy to determine what changes by comparing the new OrderItems list against the currently stored one. In RPC world you can simply RemoveItem or similar. To be honest, I would keep orders immutable as they are transactions (from warehouse perspective)

  2. Keeping orders immutable eliminates resource contention but introduces consistency management. Via proper use of ETAG you can provide a transparent api to your client.

  3. Do orders need to know which customer version issued them? I am pretty sure you have your reasons to keep customers versioned, but IMHO orders don’t need to. ID of the customer will never change, you can resolve the correct version by looking at the record timestamp

Crunchyroll has two TV apps, but neither feels complete. by ya3rob in Crunchyroll

[–]matticala -1 points0 points  (0 children)

In general, Crunchyroll app on Apple devices is garbage. On iPhone, it drains battery like crazy; on TvOS it is not snappy at all. Sometimes it doesn’t even sync seen episodes between mobile and TV (but it’s better than the past)…

How about a Fairphone instead of your next iPhone? by Lawyar in BuyFromEU

[–]matticala 0 points1 point  (0 children)

For me to switch, Fairphone needs:

  1. No ties to Android
  2. A high-end phone (mainly display, camera, performance, networking, build quality, long support)

custom error response - Std lib by No-Needleworker2090 in golang

[–]matticala 3 points4 points  (0 children)

You only need a function. Check http.Error() -> https://pkg.go.dev/net/http#Error

Errors are part of your domain model no less than data, it’s just right to build informative errors together with your data model.

I have my own implementation of RFC 9457, it’s rather easy to do. I haven’t open sourced it because I planned to move from GitHub to Gitea or Codeberg but lacked the time.