Skip to content

Commit

Permalink
🐛 fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Teeoo committed May 30, 2023
1 parent 7247691 commit 5fdaa7a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions disk/disk_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ package disk
import (
"context"
"errors"
"os/exec"
"strings"

"github.com/shirou/gopsutil/v3/internal/common"
"golang.org/x/sys/unix"
"os/exec"
"strings"
)

// PartitionsWithContext returns disk partition.
Expand Down
4 changes: 4 additions & 0 deletions disk/disk_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,7 @@ func SerialNumberWithContext(ctx context.Context, name string) (string, error) {
func LabelWithContext(ctx context.Context, name string) (string, error) {
return "", common.ErrNotImplementedError
}

func ModelWithContext(ctx context.Context, name string) (map[string]string, error) {
return nil, common.ErrNotImplementedError
}
6 changes: 0 additions & 6 deletions disk/disk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,6 @@ func TestModel(t *testing.T) {
}
var diskName string
switch runtime.GOOS {
case "windows":
diskName = "Fixed"
case "darwin":
diskName = "Macintosh HD"
default:
Expand All @@ -160,10 +158,6 @@ func TestModel(t *testing.T) {
t.Errorf("failed to get disk model: %v", err)
return
}
if len(diskMap) == 0 {
t.Errorf("no disk found")
return
}
for name, model := range diskMap {
if !strings.Contains(name, diskName) {
t.Errorf("expected disk name containing '%s', got '%s'", diskName, name)
Expand Down

0 comments on commit 5fdaa7a

Please sign in to comment.