HackerTrans
トップ新着トレンドコメント過去質問紹介求人

urzaj

no profile record

コメント

urzaj
·4 年前·議論
From the go FAQ:

> Why is len a function and not a method?

> We debated this issue but decided implementing len and friends as functions was fine in practice and didn't complicate questions about the interface (in the Go type sense) of basic types.

I imagine similar reasoning applies to "clear" here.

https://go.dev/doc/faq#methods_on_basics