Skip to content

Commit f85f945

Browse files
committed
Add commented out code allowing local development
`model/model.go` is accessing from the github repo, so to test changes to it we need to make sure it is read from the correct local folder instead.
1 parent 9b61b6f commit f85f945

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

reflect.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,18 @@ func runInDir(program []byte, dir string) (*model.PackedPkg, error) {
116116

117117
if modRoot != "" {
118118
MustCopyFile(filepath.Join(modRoot, "go.mod"), filepath.Join(tmpDir, "go.mod"))
119+
120+
// To enable local development of model/model.go, uncomment the following lines
121+
// f, err := os.OpenFile(filepath.Join(tmpDir, "go.mod"), os.O_APPEND|os.O_WRONLY, 0600)
122+
// if err != nil {
123+
// return nil, fmt.Errorf("failed to open go.mod for appending: %v", err)
124+
// }
125+
// defer f.Close()
126+
127+
// replaceDirective := "\n\nreplace github.com/github/depstubber => /Users/owen-mc/workspace/depstubber\n"
128+
// if _, err := f.WriteString(replaceDirective); err != nil {
129+
// return nil, fmt.Errorf("failed to append replace directive to go.mod: %v", err)
130+
// }
119131
}
120132
}
121133

0 commit comments

Comments
 (0)