Getwd functionis used to get the current working directory in Golang, the function returns the rooted path name and if the current directory can be reached via multiple paths, the function can return any one of them.
func Getwd()(dir string, err error)
The func returns two things the directory and also error, if there is no error it returns nil.
You may get different outputs on online compilers. For better understanding, use the offline compiler.
- Copy the entire contents of a directory to another directory in PHP
- How to Get Current time in Golang?
- How to Get Current Weekday in Golang?
- How to Get Current Date and Time in Various Format in Golang?
- How Many Logical Processors Used By Current Process in Golang?
- Getting the current date and time with timestamp in local and other timezones in Golang
- How to get current function name in PHP?
- How to get the size of screen, current web page and browser window using jQuery?
- Get the current URL using jQuery?
- How to get the current date and time in seconds?
- How to get the current weeknumber of the year?
- How to get current year in PHP ?
- How to get the path of current script using Node.js ?
- Get current timestamp using Python
- How to include() all PHP files from a directory ?
- How to Zip a directory in PHP?
- How to recursively delete a directory and its entire contents (files + sub dirs) in PHP?
- Perl | Accessing a Directory using File Globbing
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.