Further refactoring.

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
This commit is contained in:
Vishnu Kannan 2014-06-26 05:40:58 +00:00
parent ab4201f240
commit 3e5fe45417
1 changed files with 2 additions and 5 deletions

View File

@ -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