Skip to content

Instantly share code, notes, and snippets.

Created May 24, 2017 13:58
What would you like to do?
package main
import (
func main() {
value, _ := DirSize("\\\\nas1101\\Users")
func DirSize(path string) (int64, error) {
var size int64
err := filepath.Walk(path, func(_ string, info os.FileInfo, err error) error {
if !info.IsDir() {
size += info.Size()
return err
return size, err
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment