Skip to content

Commit

Permalink
Merge pull request #967 from hslatman/fix-wasm-build
Browse files Browse the repository at this point in the history
Fix `GOOS=js` builds with nops
  • Loading branch information
nr-swilloughby authored Oct 10, 2024
2 parents 42d20cb + f56aa0c commit 65528e1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
11 changes: 11 additions & 0 deletions v3/internal/sysinfo/memtotal_js.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Copyright 2020 New Relic Corporation. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

package sysinfo

import "errors"

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

package sysinfo

import "errors"

// GetUsage gathers process times.
func GetUsage() (Usage, error) {
return Usage{}, errors.New("not supported on GOOS=js")
}
2 changes: 1 addition & 1 deletion v3/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
// +build !windows,!js

package sysinfo

Expand Down

0 comments on commit 65528e1

Please sign in to comment.