标签:ext image ide vpd images amp ola col mod
package main
import (
"fmt"
"os"
"path/filepath"
)
func main() {
arguments := os.Args
if len(arguments) == 1 {
fmt.Println("Please provide an argument!")
os.Exit(1)
}
filename := arguments[1]
fileInfo, err := os.Lstat(filename)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
if fileInfo.Mode()&os.ModeSymlink != 0 {
fmt.Println(filename, "is a symbolic link")
realPath, err := filepath.EvalSymlinks(filename)
if err == nil {
fmt.Println("Path:", realPath)
}
}
}
标签:ext image ide vpd images amp ola col mod
原文地址:http://blog.51cto.com/xwandrew/2064814