In typescript, you can have an optional type like :
interface SquareConfig {
color?: string;
width?: number;
}
Is this allowed in Golang? How do I achieve that?
In typescript, you can have an optional type like :
interface SquareConfig {
color?: string;
width?: number;
}
Is this allowed in Golang? How do I achieve that?
Is this allowed in Golang?
No.
Btw: The language is called "Go".
How do I achieve that?
You do some programming, like using pointers or adding a bool which indicates validity of the fields.