34 lines
529 B
Go
34 lines
529 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"strconv"
|
|
"time"
|
|
)
|
|
|
|
var path_base = "/home/ademax/"
|
|
|
|
func main() {
|
|
|
|
Setpath()
|
|
time.Sleep(10 * time.Second)
|
|
}
|
|
func test() {
|
|
var path string
|
|
year, month, day := time.Now().Date()
|
|
path = strconv.Itoa(year) + "-" + strconv.Itoa(int(month)) + "-" + strconv.Itoa(day) + ".txt"
|
|
|
|
fmt.Println(path)
|
|
}
|
|
func Setpath() {
|
|
if os.Args != nil {
|
|
fmt.Println(os.Args)
|
|
fmt.Println(path_base)
|
|
path_base = os.Args[1]
|
|
fmt.Println("Thay the path_base")
|
|
fmt.Println("Path_base:", path_base)
|
|
}
|
|
|
|
}
|