mirror of https://github.com/shirou/gopsutil
Merge pull request #1215 from Lomanic/issue1198
[net][linux] Fix #1198 "f.ReadDir undefined" on Go 1.15 by redefining a custom readDir according to go versionpull/1221/head
commit
c56b5223c5
@ -0,0 +1,12 @@
|
||||
//go:build !go1.16
|
||||
// +build !go1.16
|
||||
|
||||
package net
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func readDir(f *os.File, max int) ([]os.FileInfo, error) {
|
||||
return f.Readdir(max)
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
//go:build go1.16
|
||||
// +build go1.16
|
||||
|
||||
package net
|
||||
|
||||
import (
|
||||
"os"
|
||||
)
|
||||
|
||||
func readDir(f *os.File, max int) ([]os.DirEntry, error) {
|
||||
return f.ReadDir(max)
|
||||
}
|
Loading…
Reference in New Issue