HOME/Articles/

Golang golang-dir (snippet)

Article Outline

Go programming example 'golang-dir'

golang-dir

Golang beginners example: golang-dir

package main

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

func main() {
    dir, _ := os.Getwd()
    fmt.Println(strings.Replace(dir, " ", "\\ ", -1))
}