1
0
mirror of https://github.com/ManyakRus/starter.git synced 2025-11-25 23:02:22 +02:00

сделал telegram_client.go

This commit is contained in:
Nikitin Aleksandr
2023-06-01 18:02:36 +03:00
parent 0f26ce5ed8
commit db2826b6ff
9 changed files with 100 additions and 23 deletions

View File

@@ -204,6 +204,7 @@ func ProgramDir_Common() string {
substr := "/tmp/"
pos1 := strings.Index(sdir, substr)
if pos1 >= 0 {
//linux
filename = CurrentFilename()
dir = filepath.Dir(filename)
@@ -216,22 +217,23 @@ func ProgramDir_Common() string {
//dir = FindDirUp(dir)
//dir = FindDirUp(dir)
}
}
} else {
//Windows
substr = "\\temp\\"
pos1 = strings.Index(sdir, substr)
if pos1 >= 0 {
filename = CurrentFilename()
dir = filepath.Dir(filename)
substr = "\\temp\\"
pos1 = strings.Index(sdir, substr)
if pos1 >= 0 {
filename = CurrentFilename()
dir = filepath.Dir(filename)
substr := SeparatorFile() + "vendor" + SeparatorFile()
pos_vendor := strings.Index(strings.ToLower(dir), substr)
if pos_vendor >= 0 {
dir = dir[0:pos_vendor]
} else if dir[len(dir)-5:] == "micro" {
dir = FindDirUp(dir)
//dir = FindDirUp(dir)
//dir = FindDirUp(dir)
substr := SeparatorFile() + "vendor" + SeparatorFile()
pos_vendor := strings.Index(strings.ToLower(dir), substr)
if pos_vendor >= 0 {
dir = dir[0:pos_vendor]
} else if dir[len(dir)-5:] == "micro" {
dir = FindDirUp(dir)
//dir = FindDirUp(dir)
//dir = FindDirUp(dir)
}
}
}