最近のGoには、関数やパッケージを非推奨と扱う方法があります。まとまっていると便利かなと思うので、種類ごとにまとめてみました。GoDocコメントを多用するので、GoDocを書き慣れていない場合は以下も参考にしてください。 blog.lufia.org 関数と型を非推奨にする 関数コメントに、// Deprecated: ではじまる段落を追加します。 // Parse parses a string of the form <status>=<status>. // // Deprecated: Use ParseStatusMap instead. func Parse(src string) (map[Status]Status, error) { ... } 型の場合も同様に。 // Error is the interface that wraps Error method. //
![Goで非推奨(Deprecated)や撤回(Retracted)を明示する方法 - Plan 9とGo言語のブログ](https://cdn-ak-scissors.b.st-hatena.com/image/square/cf22643c26db167ef1df73ff84fe077ba702a84e/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fl%2Flufiabb%2F20231012%2F20231012095411.png)