runtime: println and panic messages go to stdout, not stderr

オープン
#6,649 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
63/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go, wasm

調査の方向性

Start by reading runtime_unix.go and runtime_tinygowasm.go, the two files named in the issue, and compare their output calls with Go's behavior. Check how targets with stderr are handled and whether targets without it need different behavior. Done means print, println, and panic output go to stderr on targets that provide it; verify with the example and 2>/dev/null.

索引モデルが issue の本文から書いたものです。

説明

Go writes the output of the print and println builtins and panic messages to stderr. TinyGo writes them to stdout on Linux (libc_write(1, ...) in runtime_unix.go) and on wasm (fd_write(stdout, ...) in runtime_tinygowasm.go).

package main

func main() {
	println("hello")
	panic("boom")
}

Run with 2>/dev/null, the Go build prints nothing, and the TinyGo build prints hello and panic: boom. A program whose stdout is data, such as one piped into another, gets these lines mixed into its output.

Is stdout intended on targets that have a stderr? If not, I can send a PR.

主要言語
Go
スター
17.8k
フォーク
1.1k
平均マージ
1日 4時間
マージ済み PR(30日)
380

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tinygo-org/tinygo のほかの issue

tinygo-org/tinygo の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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