That's true. But IMO a language primitive can carry a wide variety of semantics.
Why? What's the utility? Fewer characters?
If you take
func NewServer(addr string, certKey, certCA []byte, ...) (*Server, error)
and coalesce the input parameters into type ServerConfig struct {
Addr string
CertKey []byte
CertCA []byte
...
then that type is still a meaningful domain concept in your program. There is no minimum scope requirement for discrete, named entities, is there?Right, but a struct means "a collection of named parameters", not "a concept in your domain model" although a struct can be used to model the latter.
> A discrete, named entity (a struct)
Structs don't have to be named. E.g., `var person struct { Name string; Age int }`.
> It's the same thing when "Go has no set type" comes up and people say "map[T]struct{}!" You might implement a set using a map, but they're fundamentally different concepts
It's not the same thing at all. In your analogy, a map is not a set but the advice says to use the map instead of the set anyway. But we're not talking about using one thing as another, we're talking about using a struct as a struct--one such (common) use for a struct is passing named values into a function.