a8m / a8m/golang-cheat-sheet

All non-built in types can have methods

オープン
#13 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
言語のデータがありません
スター
8.8k
フォーク
1.1k
PR マージ指標
30日以内にマージされた PR はありません

説明

https://github.com/basti1302/go-lang-cheat-sheet/blame/master/README.markdown#L345
and
https://github.com/basti1302/go-lang-cheat-sheet/blame/master/README.markdown#L361-L363

Seem to imply that functions can only be assigned to structs, however all user defined types can have methods. There is nothing unique about structs with regard to method/function declaration.

see example:
https://play.golang.org/p/DPFZz0mCbi

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。