概要 去年の8月に社会人エンジニアになり、今年の2月までAPIサーバーの開発をRuby on Railsで行なっていた新卒Rubyistです。 3月にサーバーサイドを全てGolangで行う会社に転職しました。今までRailsでの業務が多かったため、interface{}という概念がどうしても身につきませんでしたが、ある程度業務に慣れ、戦い続けて学んだことをまとめようと思いました。 Golangのinterfaceについては知見は多くあるのですが、今年はアウトプットを大事にしていきたいという目標から、記事にまとめました。 下に読む前に Golangのインタフェースは型の1つです。 string や int64 が関数を持っているように、インタフェースで型を宣言してその型に関数を持たせることができます。 構造体がインタフェースで宣言されているGetRadius関数を持つと、この構造体の型はCi