os.Path.rootDir

Returns the root directory of the current working path.

Syntax

os.Path.rootDir()
  RETURNING rootdir STRING
  1. rootdir is the root directory of the current working path.

Usage

On UNIX™, it always returns "/".

On Windows™ it returns the current working drive as "[a-zA-Z]:\"