File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ func apply(update io.Reader, opts *Options) error {
107107 updateDir := filepath .Dir (opts .TargetPath )
108108 filename := filepath .Base (opts .TargetPath )
109109
110- // Copy the contents of newbinary to a new executable file
110+ // Copy the contents of the new binary to a new executable file
111111 newPath := filepath .Join (updateDir , fmt .Sprintf (".%s.new" , filename ))
112112 fp , err := openFile (newPath , os .O_CREATE | os .O_WRONLY | os .O_TRUNC , opts .TargetMode )
113113 if err != nil {
@@ -120,7 +120,7 @@ func apply(update io.Reader, opts *Options) error {
120120 if err != nil {
121121 return err
122122 }
123- //don't call fp.Sync(). system power off ,file will lost
123+ // if we don't call fp.Sync(), a system power off could lose the file
124124 fp .Sync ()
125125 // if we don't call fp.Close(), windows won't let us move the new executable
126126 // because the file will still be "in use"
@@ -144,7 +144,7 @@ func apply(update io.Reader, opts *Options) error {
144144 return err
145145 }
146146
147- // move the new exectuable in to become the new program
147+ // move the new executable in to become the new program
148148 err = os .Rename (newPath , opts .TargetPath )
149149
150150 if err != nil {
You can’t perform that action at this time.
0 commit comments