Goにはクラスがありませんが、代わりに構造体のアイデアを推進していることに気付きました。
構造体には、クラスの __construct() 関数と同様に呼び出すことができる初期化関数がありますか?
例:
type Console struct {
X int
Y int
}
func (c *Console) init() {
c.X = "5"
}
// Here I want my init function to run
var console Console
// or here if I used
var console Console = new(Console)