Skip to content
Node: path.isAbsolute(p)github.com/sahilkhaire/gox/path

IsAbs

Overview

IsAbs reports whether p is absolute (path.isAbsolute).

If you are coming from Node.js, the closest pattern is path.isAbsolute(p).

Signature

go
func IsAbs(p string) bool

Compare: Node.js · Standard Go · gox

js
path.isAbsolute('/foo');
go
ok := filepath.IsAbs(p)
go
import "github.com/sahilkhaire/gox/path"

ok := path.IsAbs(p)

Example

go
import "github.com/sahilkhaire/gox/path"

ok := path.IsAbs(p)

Tips

Import github.com/sahilkhaire/gox/path and call IsAbs directly. See the comparison below for the standard library equivalent.

Standard library alternative

Use the standard library directly:

go
ok := filepath.IsAbs(p)

Back to path package overview

MIT Licensed · Built for Node.js developers moving to Go