curr

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: MIT Imports: 3 Imported by: 1

README

curr

CircleCI codecov Go Report Card GoDoc

Current file and dir privider for Golang.

Just a sugar for runtime.

import "curr"

// __FILE__
f := curr.File()

// __DIR__
d := curr.Dir()

// __LINE__
l := curr.Line()

// __FUNCTION__
fn := curr.Func()

// basename(__FILE__)
b := curr.Basename()

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Basename

func Basename() string

Basename is current file basename provider, like `basename(__FILE__)` of PHP.

func Dir

func Dir() string

Dir is current directory provider, like `__DIR__` of PHP.

func File

func File() string

File is current file name provider, like `__FILE__` of PHP.

func Func

func Func() string

Func is current function name provider, like `__FUNCTION__` of PHP.

func Line

func Line() int

Line is current line provider, like `__LINE__` of PHP.

Types

This section is empty.

Jump to

Keyboard shortcuts

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