gopkgpath

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

Package cloudeng.io/path/gopkgpath

import cloudeng.io/path/gopkgpath

Package gopkgpath provides support for obtaining and working with go package paths when go modules are used. It does not support vendor or GOPATH configurations.

Functions

Func Caller
func Caller() (string, error)

Caller is the same as CallerDepth(0).

Func CallerDepth
func CallerDepth(depth int) (string, error)

CallerDepth returns the package path of the caller at the specified depth where a depth of 0 is the immediate caller. It determines the module name by finding and parsing the enclosing go.mod file and as such requires that go modules are being used.

Func Type
func Type(v interface{}) string

Type returns the package path for the type of the supplied argument. That type must be a defined/named type, anoymous types, function variables etc will return "".

Documentation

Overview

Package gopkgpath provides support for obtaining and working with go package paths when go modules are used. It does not support vendor or GOPATH configurations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Caller

func Caller() (string, error)

Caller is the same as CallerDepth(0).

func CallerDepth

func CallerDepth(depth int) (string, error)

CallerDepth returns the package path of the caller at the specified depth where a depth of 0 is the immediate caller. It determines the module name by finding and parsing the enclosing go.mod file and as such requires that go modules are being used.

func Type

func Type(v interface{}) string

Type returns the package path for the type of the supplied argument. That type must be a defined/named type, anoymous types, function variables etc will return "".

Types

This section is empty.

Jump to

Keyboard shortcuts

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