5 Comments
User's avatar
Nabib's avatar

If the code syntax highlighting was there it will be more better to read code

Expand full comment
Alex Pliutau's avatar

Exactly, the biggest limitation of Substack for me. That’s why I always share a repo as well.

Expand full comment
Alugbin Abiodun's avatar

Don do `SetTitle`.

title is already exported, so no need to have a setter method on it.

Instead make `title` unexported, then you can provide a setter.

Expand full comment
Alex Pliutau's avatar

True, I don't usually use Getters and Setters in Go, as you can always do struct.title = x, which is shorter and clean. But it makes sense in interfaces. And yes, it should be unexported (edited)

Expand full comment
Michał M.'s avatar

Hello, when it comes to DIP and: "In simpler terms, DIP advises that your code should depend on interfaces or abstract classes rather than concrete classes or functions."

This is not true, actually. When high- and low-level modules are mentioned they refer to business logic (rules) and infrastructure (e.g. database, web, external interfaces), not just language specific interfaces/abstract classes nor specific class implementations/functions.

Expand full comment