Golang os.Getwd() function example

package os

Golang os.Getwd() function usage example

  package main

  import (
 "fmt"
 "os"
 "strings"
  )

  func main() {
 dir, _ := os.Getwd()
 fmt.Println(dir)
  }

References :

http://golang.org/pkg/os/#Getwd

https://www.socketloop.com/tutorials/golang-get-current-directory-or-folder

Advertisement