0
0

Go言語(Golang) "godoc"と"go doc"

Last updated at Posted at 2024-09-02

go docgodocの違い

1.使用方法:

  • go doc: コマンドラインで直接使用
  • godoc: ウェブサーバーを起動し、ブラウザで閲覧

2.機能:

  • go doc: シンプルなドキュメント表示
  • godoc: 詳細なドキュメント表示、ソースコードリンク、検索機能

3.インストール:

  • go doc: Go標準ツールチェーンに含まれる
  • godoc: Go標準ツールチェーンに含まれる

4.用途:

  • go doc: 素早い情報確認
  • godoc: 包括的なドキュメント閲覧

5.出力形式:

  • go doc: テキスト形式
  • godoc: HTML形式(ブラウザで表示)

go docの例

1.パッケージのドキュメントを表示:

go doc fmt

2.特定の関数のドキュメントを表示:

go doc fmt.Println

3.特定の型のドキュメントを表示:

go doc time.Time

godocの例

1.ウェブサーバーを起動 (デフォルトポート6060):

godoc -http=:6060

2.カスタムポートでウェブサーバーを起動:

godoc -http=:8080
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0