google / renameio

Package renameio provides a way to atomically create or replace a file or symbolic link.
Apache License 2.0
609 stars 27 forks source link

maybe: doesn't build on Windows #29

Closed ainar-g closed 3 years ago

ainar-g commented 3 years ago

The text of package maybe implies that it could run on Windows:

if runtime.GOOS == "windows" {
        return ioutil.WriteFile(filename, data, perm)
}
return renameio.WriteFile(filename, data, perm)

But it wont, since renameio.WriteFile doesn't exist when building on Windows. It should probably use build tags (and go:build directives) instead of runtime.GOOS.

mvdan commented 3 years ago

Perhaps release this as v1.0.1? I ran into build failures when upgrading to v1.0.0, and then I switched to /maybe, and then it still failed because of this bug :)

stapelberg commented 3 years ago

Perhaps release this as v1.0.1

Now done