/
path.go
executable file
·38 lines (34 loc) · 904 Bytes
/
path.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main
import (
"os"
"log"
"os/exec"
"fmt"
"path"
)
func main() {
file, _ := os.Getwd()
// log.Println("current path:", file)
// fmt.Println(os.Args[0])
// file, _ = exec.LookPath(os.Args[0])
abs := fmt.Sprintf(`%s/metronic/templates/admin/extra_profile.html`, file)
// fmt.Println(abs)
file, _ = exec.LookPath(fmt.Sprintf(`%smetronic/templates/admin/extra_profile.html`, file))
// fmt.Printf("%T", os.Args[0])
// fmt.Println(file)
log.Println("exec path:", file)
filename := path.Dir(abs)
os.MkdirAll(filename, 0777)
dir, _ := path.Split(file)
log.Println("exec folder relative path:", dir)
os.OpenFile(file, os.O_CREATE, 0777)
os.Chdir(dir)
wd, _ := os.Getwd()
log.Println("exec folder absolute path:", wd)
fmt.Println("\n");
m := map[string]map[string]string{}
m["dasdfsdf"]["dfsadfasf"]="sdfdsfsfsfddsfww";
if m["dasdfsssdf"]=="" {
fmt.Println(m["dasdfsdf"])
}
}