_, file, _, _ := runtime.Caller(0)
fmt.Println(file) // /home/qinyi/goProjectModule/p2/main.go
baseFileName := path.Base(file)
fmt.Println(baseFileName) // main.go
fileExt := path.Ext(file)
fmt.Println(fileExt) // .go
fileDir := path.Dir(file)
fmt.Println(fileDir) // /home/qinyi/goProjectModule/p2
fmt.Println(path.Dir(fileDir)) // /home/qinyi/goProjectModule
fileName := strings.TrimSuffix(baseFileName, fileExt)
fmt.Println(fileName) // main