Skip to content

Commit 389d161

Browse files
Merge pull request #478 from taufik-rama/fix/js_wasm
Added noop operations for js/wasm build target
2 parents 665ac98 + 6f2aa06 commit 389d161

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

internal/sysinfo/memtotal_js.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2020 New Relic Corporation. All rights reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
//go:build js && wasm
5+
6+
package sysinfo
7+
8+
import "errors"
9+
10+
// PhysicalMemoryBytes returns the total amount of host memory.
11+
func PhysicalMemoryBytes() (uint64, error) {
12+
return 0, errors.New("unsupported js/wasm arch")
13+
}

internal/sysinfo/usage_js.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2020 New Relic Corporation. All rights reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
//go:build js && wasm
5+
6+
package sysinfo
7+
8+
import "errors"
9+
10+
// GetUsage gathers process times.
11+
func GetUsage() (Usage, error) {
12+
return Usage{}, errors.New("unsupported js/wasm arch")
13+
}

internal/sysinfo/usage_posix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2020 New Relic Corporation. All rights reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4-
// +build !windows
4+
//go:build !windows && !(js && wasm)
55

66
package sysinfo
77

0 commit comments

Comments
 (0)