2018-12-17から1日間の記事一覧
オブジェクト指向のデザインパターンである、Singletonを実装する例です。 type Menu struct { name string price int } var mymenu *Menu = newMenu("未定", 0) // 定義時に func newMenu(name string, price int) *Menu { // コンストラクタのように初期化…
オブジェクト指向のデザインパターンである、Singletonを実装する例です。 type Menu struct { name string price int } var mymenu *Menu = newMenu("未定", 0) // 定義時に func newMenu(name string, price int) *Menu { // コンストラクタのように初期化…