How to Get the Current Working Directory in Golang?
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.