Skip to content

Commit

Permalink
Merge pull request #478 from taufik-rama/fix/js_wasm
Browse files Browse the repository at this point in the history
Added noop operations for js/wasm build target
  • Loading branch information
nr-swilloughby committed Jun 29, 2022
2 parents 665ac98 + 6f2aa06 commit 389d161
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
13 changes: 13 additions & 0 deletions internal/sysinfo/memtotal_js.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2020 New Relic Corporation. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

//go:build js && wasm

package sysinfo

import "errors"

// PhysicalMemoryBytes returns the total amount of host memory.
func PhysicalMemoryBytes() (uint64, error) {
return 0, errors.New("unsupported js/wasm arch")
}
13 changes: 13 additions & 0 deletions internal/sysinfo/usage_js.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Copyright 2020 New Relic Corporation. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

//go:build js && wasm

package sysinfo

import "errors"

// GetUsage gathers process times.
func GetUsage() (Usage, error) {
return Usage{}, errors.New("unsupported js/wasm arch")
}
2 changes: 1 addition & 1 deletion internal/sysinfo/usage_posix.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2020 New Relic Corporation. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

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

package sysinfo

Expand Down

0 comments on commit 389d161

Please sign in to comment.