Skip to content

Commit

Permalink
add f.Sync to try and address #9
Browse files Browse the repository at this point in the history
  • Loading branch information
shayne committed Nov 11, 2019
1 parent 1002041 commit b76050d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.exe
.vscode/
vendor/
example/
examples/
foo.go
foo_test.go
4 changes: 4 additions & 0 deletions pkg/hostsapi/hostsapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ func (h *HostsAPI) Write() error {
defer f.Close()

f.Write(outbuf.Bytes())
err = f.Sync()
if err != nil {
return err
}

return nil
}

0 comments on commit b76050d

Please sign in to comment.