gojs: adds support for uid and gid (#1245)

This adds `gojs.WithOSUser` which passes through current user IDs so
that GOOS=js compiled wasm can read them. This also adds support for
reading back the uid and gid on files. In summary, this passes
`os.TestChown` except on windows where it will not work due to lack of
support.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Crypt Keeper
2023-03-16 11:07:27 +08:00
committed by GitHub
parent e17a85146a
commit 8464474e21
25 changed files with 556 additions and 270 deletions

View File

@@ -67,7 +67,7 @@ type fetchResult struct {
}
// Get implements the same method as documented on goos.GetFunction
func (s *fetchResult) Get(_ context.Context, propertyKey string) interface{} {
func (s *fetchResult) Get(propertyKey string) interface{} {
switch propertyKey {
case "headers":
names := make([]string, 0, len(s.res.Header))
@@ -104,7 +104,7 @@ type headers struct {
}
// Get implements the same method as documented on goos.GetFunction
func (h *headers) Get(_ context.Context, propertyKey string) interface{} {
func (h *headers) Get(propertyKey string) interface{} {
switch propertyKey {
case "done":
return h.i == len(h.names)