-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #581 from nginx-proxy/fix-windows-build
fix: windows build
- Loading branch information
Showing
3 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//go:build linux || darwin | ||
|
||
package template | ||
|
||
import ( | ||
"io/fs" | ||
"log" | ||
"os" | ||
"syscall" | ||
) | ||
|
||
func chown(dest *os.File, fi fs.FileInfo) { | ||
if stat, ok := fi.Sys().(*syscall.Stat_t); ok { | ||
if err := dest.Chown(int(stat.Uid), int(stat.Gid)); err != nil { | ||
log.Fatalf("Unable to chown temp file: %s\n", err) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//go:build windows | ||
|
||
package template | ||
|
||
import ( | ||
"io/fs" | ||
"os" | ||
) | ||
|
||
func chown(dest *os.File, fi fs.FileInfo) { | ||
// do nothing | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters