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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user