Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ Real output from `godebugdiff` with no flags, on Go 1.27.3, on shallow clones of
| `rclone.txt` | github.com/rclone/rclone | `f0cb5dd` | MIT |

To redo one: clone the project, check out the commit, run `go mod download`, then `go run ./plugin/scripts PATH` from this repo. The results depend on the toolchain you run.

The shop output and `cobra.txt` were regenerated on 2026-11-15 with Go 1.27.4. The Cobra checkout remains at the commit listed above; other saved real-project outputs retain their original toolchain.
6 changes: 3 additions & 3 deletions examples/real/cobra.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.15 -> 1.27 in github.com/spf13/cobra (go1.27.3, 2 test binaries)
go 1.15 -> 1.27 in github.com/spf13/cobra (go1.27.4, 2 test binaries)

28 GODEBUG defaults change. 13 reach a package your test binaries import.

Expand All @@ -12,12 +12,12 @@ panicnil 1 -> default Go 1.21, runtime
Go 1.21 made it a run-time error to call panic with a nil interface value, controlled by the panicnil setting.
https://go.dev/doc/godebug#go-121

winreadlinkvolume 0 -> default Go 1.23, os
winreadlinkvolume 0 -> default Go 1.23, os (Windows only)
imported by all 2 test binaries
Go 1.23 changed os.Readlink and filepath.EvalSymlinks to avoid trying to normalize volumes to drive letters, which was not always even possible.
https://go.dev/doc/godebug#go-123

winsymlink 0 -> default Go 1.23, os
winsymlink 0 -> default Go 1.23, os (Windows only)
imported by all 2 test binaries
Go 1.23 changed the mode bits reported by os.Lstat and os.Stat for reparse points, which can be controlled with the winsymlink setting.
https://go.dev/doc/godebug#go-123
Expand Down
6 changes: 3 additions & 3 deletions examples/shop-1.21-to-1.24.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.21 -> 1.24 in example.com/shop (go1.27.3, 2 binaries)
go 1.21 -> 1.24 in example.com/shop (go1.27.4, 2 binaries)

15 GODEBUG defaults change. 14 reach a package your binaries import.

Expand All @@ -17,12 +17,12 @@ httpservecontentkeepheaders 1 -> default Go 1.23, net/http
Go 1.23 changed net/http.ServeContent, net/http.ServeFile, and net/http.ServeFS to remove Cache-Control, Content-Encoding, Etag, and Last-Modified headers when serving an error.
https://go.dev/doc/godebug#go-123

winreadlinkvolume 0 -> default Go 1.23, os
winreadlinkvolume 0 -> default Go 1.23, os (Windows only)
imported by all 2 binaries
Go 1.23 changed os.Readlink and filepath.EvalSymlinks to avoid trying to normalize volumes to drive letters, which was not always even possible.
https://go.dev/doc/godebug#go-123

winsymlink 0 -> default Go 1.23, os
winsymlink 0 -> default Go 1.23, os (Windows only)
imported by all 2 binaries
Go 1.23 changed the mode bits reported by os.Lstat and os.Stat for reparse points, which can be controlled with the winsymlink setting.
https://go.dev/doc/godebug#go-123
Expand Down
2 changes: 1 addition & 1 deletion plugin/scripts/godebugdiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type Change struct {
After string `json:"after"`
ReachedBy []string `json:"reachedBy"` // binaries that import Package
GoCommand bool `json:"goCommand"` // the setting controls the go command, not binaries
WindowsOnly bool `json:"windowsOnly,omitempty"` // name starts with win; Linux services can skip
WindowsOnly bool `json:"windowsOnly,omitempty"` // Windows-specific setting; relevance depends on the deployment platform
Doc string `json:"doc,omitempty"`
URL string `json:"url,omitempty"`
}
Expand Down
21 changes: 21 additions & 0 deletions plugin/scripts/godebugdiff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,3 +273,24 @@ func TestWindowsOnly(t *testing.T) {
t.Fatalf("JSON missing windowsOnly: %s", enc)
}
}

func TestCompareWindowsOnly(t *testing.T) {
before := []Binary{{ImportPath: "example.com/app", Godebug: parseGodebug("winreadlinkvolume=0,httpmuxgo121=1"), Deps: map[string]bool{"os": true, "net/http": true}}}
after := []Binary{{ImportPath: "example.com/app", Godebug: parseGodebug(""), Deps: map[string]bool{"os": true, "net/http": true}}}
table := map[string]Setting{
"winreadlinkvolume": {Name: "winreadlinkvolume", Package: "os", Changed: 26, Old: "0"},
"httpmuxgo121": {Name: "httpmuxgo121", Package: "net/http", Changed: 22, Old: "1"},
}
changes, _ := compare(before, after, table, nil)
if len(changes) != 2 {
t.Fatalf("changes: %+v", changes)
}
for _, c := range changes {
if c.WindowsOnly != (c.Name == "winreadlinkvolume") {
t.Errorf("platform classification: %+v", c)
}
if !reflect.DeepEqual(c.ReachedBy, []string{"example.com/app"}) {
t.Errorf("reachedBy: %+v", c)
}
}
}
Loading