-
Notifications
You must be signed in to change notification settings - Fork 0
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 #60 from skx/windows-build
Windows build
- Loading branch information
Showing
5 changed files
with
78 additions
and
8 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
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
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
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,31 @@ | ||
//go:build !windows | ||
|
||
package builtins | ||
|
||
import ( | ||
"os" | ||
"syscall" | ||
) | ||
|
||
// getGID returns the group of the file, from the extended information | ||
// available after a stat - that is not portable to Windows though. | ||
// | ||
// This is in a separate file so that we use build-tags to build code | ||
// appropriately. | ||
func getGID(info os.FileInfo) (int, error) { | ||
|
||
stat, _ := info.Sys().(*syscall.Stat_t) | ||
return int(stat.Gid), nil | ||
} | ||
|
||
|
||
// getUID returns the owner of the file, from the extended information | ||
// available after a stat - that is not portable to Windows though. | ||
// | ||
// This is in a separate file so that we use build-tags to build code | ||
// appropriately. | ||
func getUID(info os.FileInfo) (int, error) { | ||
|
||
stat, _ := info.Sys().(*syscall.Stat_t) | ||
return int(stat.Uid), nil | ||
} |
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,34 @@ | ||
//go:build windows | ||
|
||
package builtins | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
) | ||
|
||
// getGID should return the group of the file, from the extended information | ||
// available after a stat, however on Windows platforms that doesn't work | ||
// in the obvious way. | ||
// | ||
// Here we just return an error to make that apparent to the caller. | ||
// | ||
// This is in a separate file so that we use build-tags to build code | ||
// appropriately. | ||
func getGID(info os.FileInfo) (int, error) { | ||
|
||
return 0, fmt.Errorf("not found") | ||
} | ||
|
||
// getUID should return the owner of the file, from the extended information | ||
// available after a stat, however on Windows platforms that doesn't work | ||
// in the obvious way. | ||
// | ||
// Here we just return an error to make that apparent to the caller. | ||
// | ||
// This is in a separate file so that we use build-tags to build code | ||
// appropriately. | ||
func getUID(info os.FileInfo) (int, error) { | ||
|
||
return 0, fmt.Errorf("not found") | ||
} |