func resolveSymlinks(fn string, info *os.FileInfo) (wasLink bool, err error) {
	newinfo := *info

	// if we have a symlink, resolve the symlink
	if newinfo.Mode()&os.ModeSymlink != 0 {
		wasLink = true

		// resolve the directory
		base := filepath.Dir(fn)

		// resolve the new path
		fn, err = filepath.EvalSymlinks(fn)
		if err != nil {
			return
		}

		// if filepath is not absolute, make it absolute relative to the base
		if !filepath.IsAbs(fn) {
			fn = filepath.Join(base, fn)
		}

		newinfo, err = os.Stat(fn)
		if err == nil {
			*info = newinfo
		}
	} else {
		wasLink = false
	}

	// and return if we had an error
	return
}
// resolveSymlinks resolves the symlinks of a fileinfo
resolveSymlinks resolves the symlinks of a fileinfo
// resolveSymlinks resolves the symlinks of a fileinfo
func resolveSymlinks(fn string, info *os.FileInfo) (wasLink bool, err error) {
	newinfo := *info
	if newinfo.Mode()&os.ModeSymlink != 0 {
		wasLink = true
		base := filepath.Dir(fn)
		fn, err = filepath.EvalSymlinks(fn)
		if err != nil {
			return
		}
		if !filepath.IsAbs(fn) {
			fn = filepath.Join(base, fn)
		}
		newinfo, err = os.Stat(fn)
		if err == nil {
			*info = newinfo
		}
	} else {
		wasLink = false
	}
	return
}
func resolveSymlinks ( fn string , info * os . FileInfo ) ( wasLink bool , err error ) { newinfo := * info if newinfo . Mode ( ) & os . ModeSymlink != 0 { wasLink = true base := filepath . Dir ( fn ) fn , err = filepath . EvalSymlinks ( fn ) if err != nil { return } if ! filepath . IsAbs ( fn ) { fn = filepath . Join ( base , fn ) } newinfo , err = os . Stat ( fn ) if err == nil { * info = newinfo } } else { wasLink = false } return }
resolveSymlinks resolves the symlinks of a fileinfo
resolveSymlinks resolves the symlinks of a fileinfo
// if we have a symlink, resolve the symlink // resolve the directory // resolve the new path // if filepath is not absolute, make it absolute relative to the base // and return if we had an error