Regenerate saved examples and test that compare() sets windowsOnly

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

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

評価

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

調査の方向性

Start with make examples and the diff command in the issue, which compares examples/shop output against examples/shop-1.21-to-1.24.txt; examples/real/cobra.txt needs the project cloned, per examples/README.md. For the test gap, read compare() and isWindowsOnly in plugin/scripts, then TestWindowsOnly, which sets WindowsOnly by hand. Done means the regenerated examples match, a test through compare() or tests/ fails when the assignment is removed, and the three polish points are settled.

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

説明

Follow-up from #7. The Windows-only mark works; these are small cleanups.

  1. Saved examples are out of date. To reproduce: go run ./plugin/scripts --from 1.21 --to 1.24 examples/shop | diff examples/shop-1.21-to-1.24.txt - differs at lines 20 and 25, which lack (Windows only). Run make examples. examples/real/cobra.txt lists the same settings, so update it too (it needs the project cloned, see examples/README.md).

  2. No test checks that compare() sets the flag. TestWindowsOnly sets WindowsOnly: true by hand. To reproduce: delete c.WindowsOnly = isWindowsOnly(k) from compare() and run go test -count=1 ./.... Both packages still pass, while the report loses the mark. Add a test through compare() or tests/ asserting that winsymlink gets windowsOnly: true and a non-win setting does not. Computing the mark from the name in one place, instead of storing it on Change, would also remove the chance of the two disagreeing.

  3. Output and JSON polish:

  • The "No binary imports the package, so no effect" section prints winsymlink (os) (Windows only), where the mark adds nothing. To reproduce: run the tool from 1.22 to 1.23 on a module whose only binary is an empty func main() {}.
  • windowsOnly uses omitempty while goCommand is always present, so the JSON key is absent for most changes. Decide whether to always emit it.
  • The field comment on WindowsOnly says "Linux services can skip", which does not hold for modules built for Windows. Reword it.
  • Windows-only settings still count as reaching binaries and still appear in the suggested go.mod pins. That is accurate for Windows builds, but consider saying in the report that Linux-only services can ignore those pins.
主要言語
Go
スター
0
フォーク
3
平均マージ
6時間 20分
マージ済み PR(30日)
3

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

GillMacedo/godebugdiff のほかの issue

GillMacedo/godebugdiff の issue をすべて見る

似ている issue

Go の issue をもっと見る

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

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