Further refactoring.
Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
This commit is contained in:
parent
ab4201f240
commit
3e5fe45417
|
@ -44,11 +44,8 @@ func GetStats(networkState *NetworkState) (NetworkStats, error) {
|
|||
func readSysfsNetworkStats(ethInterface string) (map[string]uint64, error) {
|
||||
out := make(map[string]uint64)
|
||||
|
||||
fullPath, err := filepath.Abs(filepath.Join("/sys/class/net", ethInterface, "statistics/"))
|
||||
if err != nil {
|
||||
return out, nil
|
||||
}
|
||||
err = filepath.Walk(fullPath, func(path string, _ os.FileInfo, _ error) error {
|
||||
fullPath := filepath.Join("/sys/class/net", ethInterface, "statistics/")
|
||||
err := filepath.Walk(fullPath, func(path string, _ os.FileInfo, _ error) error {
|
||||
// skip fullPath.
|
||||
if path == fullPath {
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue