Skip to content
Open
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
10 changes: 7 additions & 3 deletions src/cmd/go/internal/workcmd/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,9 @@ func editPrintJSON(workFile *modfile.WorkFile) {
for _, d := range workFile.Use {
f.Use = append(f.Use, useJSON{DiskPath: d.Path, ModPath: d.ModulePath})
}
if workFile.Toolchain != nil {
f.Toolchain = workFile.Toolchain.Name
}

for _, r := range workFile.Replace {
f.Replace = append(f.Replace, replaceJSON{r.Old, r.New})
Expand All @@ -366,9 +369,10 @@ func editPrintJSON(workFile *modfile.WorkFile) {

// workfileJSON is the -json output data structure.
type workfileJSON struct {
Go string `json:",omitempty"`
Use []useJSON
Replace []replaceJSON
Go string `json:",omitempty"`
Toolchain string `json:",omitempty"`
Use []useJSON
Replace []replaceJSON
}

type useJSON struct {
Expand Down