Skip to content

Commit

Permalink
Fix GOOS=js builds with nops
Browse files Browse the repository at this point in the history
  • Loading branch information
hslatman committed Oct 1, 2024
1 parent 6c84bcf commit 27f7a65
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 27f7a65

Please sign in to comment.