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

build broken on freebsd due to invalid cast in disk/getFsType() #906

Closed
knz opened this issue Jul 14, 2020 · 1 comment
Closed

build broken on freebsd due to invalid cast in disk/getFsType() #906

knz opened this issue Jul 14, 2020 · 1 comment

Comments

@knz
Copy link

knz commented Jul 14, 2020

Describe the bug

Build fails:

/github.com/shirou/gopsutil/disk/disk_freebsd.go:195:43: cannot use stat.Fstypename[:] (type []byte) as type []int8 in argument to common.IntToString

To Reproduce

build on FreeBSD

Expected behavior

build succeeds

Environment (please complete the following information):

FreeBSD 13-CURRENT on amd64

Additional context

The following diff fixes the bug and keeps the functionality:

@@ -192,5 +193,5 @@ func parseDevstat(buf []byte) (Devstat, error) {
 }

 func getFsType(stat unix.Statfs_t) string {
-       return common.IntToString(stat.Fstypename[:])
+       return string(stat.Fstypename[:])
 }
@Lomanic
Copy link
Collaborator

Lomanic commented Jul 14, 2020

Upgrade golang.org/x/sys, see #853 for context.

@Lomanic Lomanic closed this as completed Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants