Bye Bye Moore

PoCソルジャーな零細事業主が作業メモを残すブログ

2017-05-09から1日間の記事一覧

カプセル化とアレコレ

package main import ( "fmt" ) type MyType struct { num int body []byte ans string } func (mt *MyType) String() string { return fmt.Sprintf("%d::%s\n", mt.num, mt.body) } func (mt *MyType) setAns() string { mt.ans = fmt.Sprintf("Num value i…