• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

go-pkgz / fileutils / 32205524377
72%

Build:
DEFAULT BRANCH: master
Ran 19 Aug 2026 01:36AM UTC
Jobs 1
Files 2
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 Aug 2026 01:36AM UTC coverage: 70.326% (-1.0%) from 71.338%
32205524377

push

github

web-flow
fix CopyFile erasing its source and not preserving mode on overwrite (#10)

CopyFile opened the destination with O_TRUNC, so when src and dst resolved to
the same file the source was truncated before anything was read from it and the
call returned an incomplete-copy error over an emptied file. The same happened
for hard link and symlink aliases, and for CopyDir(dir, dir).

The destination is now opened without O_TRUNC, stat'ed through its own
descriptor and compared with os.SameFile before it is truncated, so an aliased
destination is rejected with the data untouched.

The mode argument of OpenFile only applies when the file is created, and is
filtered by umask, so the documented mode preservation did not hold: an existing
destination kept its own mode and a new one got the source mode minus umask. The
destination is now chmod'ed to the source mode after the copy.

The source is re-stat'ed through its descriptor and re-checked for being a
regular file, so a path swapped between the stat and the open cannot reach the
copy with a stale size or type.

14 of 24 new or added lines in 1 file covered. (58.33%)

237 of 337 relevant lines covered (70.33%)

4.19 hits per line

Uncovered Changes

Lines Coverage ∆ File
10
76.23
-2.27% fileutils.go
Jobs
ID Job ID Ran Files Coverage
1 32205524377.1 19 Aug 2026 01:36AM UTC 2
70.33
GitHub Action Run
Source Files on build 32205524377
  • Tree
  • List 2
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 440fb674 on github
  • Prev Build on master (#19903537011)
  • Next Build on master (#32205961824)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc