gopwd

package module
v0.0.0-...-74fdd3a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2019 License: MIT Imports: 4 Imported by: 0

README

DevOps By Rultor.com

CircleCI Build Status

PDD status License

Golang library to get current working directory absolute path or its name.

Usage

Download: go get -u github.com/g4s8/gopwd

Example:

import "github.com/g4s8/gopwd"
import "fmt"

func main() {
  pwd, err := gopwd.Name()
  if err != nil {
    panic(err)
  }
  fmt.Printf("Current directory is %s\n", pwd)
}

Contribution

Fork repository, clone it, make changes, push to new branch and submit a pull request.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abs

func Abs() (string, error)

Abs - return absolute path to current working directory. E.g. `/tmp/test` if you run app here.

func Name

func Name() (string, error)

Name - return current working directory name, e.g. `test` if you run app in `/tmp/test`.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL