The Filemode variable in tree.go:212 is not large enough to support operating systems with 32bit S_IFMT constants. In zOS for example, S_IFMT = 0xFF000000. The current implementation will not run on zOS due to overflow errors.
Perhaps increasing to an int64 would help compatibility?