mirror of
https://github.com/MADTeacher/go_basics.git
synced 2025-11-23 21:34:47 +02:00
22 lines
213 B
Go
22 lines
213 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
func getWD() {
|
|
path, err := os.Getwd()
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
fmt.Println("Current path:", path)
|
|
}
|
|
|
|
func main() {
|
|
getWD()
|
|
os.Chdir("../")
|
|
getWD()
|
|
}
|