Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix GOOS=js builds with nops #967

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading