File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1313
1414 argOld = cli .Arg ("old" , "The old file." ).Required ().ExistingFile ()
1515 argNew = cli .Arg ("new" , "The new file." ).Required ().ExistingFile ()
16- argPatch = cli .Arg ("patch" , "Where to output the patch file." ).Required ().File ()
16+ argPatch = cli .Arg ("patch" , "Where to output the patch file." ).Required ().String ()
1717)
1818
1919func must (err error ) {
@@ -27,7 +27,8 @@ func must(err error) {
2727func main () {
2828 kingpin .MustParse (cli .Parse (os .Args [1 :]))
2929
30- patchFile := * argPatch
30+ patchFile , err := os .Create (* argPatch )
31+ must (err )
3132 defer patchFile .Close ()
3233
3334 oldFile , err := os .Open (* argOld )
Original file line number Diff line number Diff line change 1212 cli = kingpin .New ("go-bspatch" , "Applies binary patches generated using the bsdiff algorithm." )
1313
1414 argOld = cli .Arg ("old" , "The old file." ).Required ().ExistingFile ()
15- argNew = cli .Arg ("new" , "Where the new file will be written to." ).Required ().File ()
15+ argNew = cli .Arg ("new" , "Where the new file will be written to." ).Required ().String ()
1616 argPatch = cli .Arg ("patch" , "The patch file." ).Required ().ExistingFile ()
1717)
1818
@@ -27,13 +27,14 @@ func must(err error) {
2727func main () {
2828 kingpin .MustParse (cli .Parse (os .Args [1 :]))
2929
30- newFile := * argNew
31- defer newFile .Close ()
32-
3330 oldFile , err := os .Open (* argOld )
3431 must (err )
3532 defer oldFile .Close ()
3633
34+ newFile , err := os .Create (* argNew )
35+ must (err )
36+ defer newFile .Close ()
37+
3738 patchFile , err := os .Open (* argPatch )
3839 must (err )
3940 defer patchFile .Close ()
You can’t perform that action at this time.
0 commit comments