path

package
v0.0.0-...-6b15219 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package path includes a few simple convenience methods for dealing with paths

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AbsoluteGoPkgPath

func AbsoluteGoPkgPath(pkgImport string) (string, error)

AbsoluteGoPkgPath takes a pkg import and returns the full path to the pkg on this system. The pkgImport must denote an actual package of go files or it will error. It first looks for the right package in $GOPATH, and returns that if it finds it. If that doesn't work it falls back on `go list`, which will try to download it if it cannot already be satisfied locally. Because this uses the $GOPATH copy first, that allows for example relying on games locally without going through a VCS, which is nice if you're not connected to the internet. If you're trying to load up Game Packages, you should likely use the lib/gamepkg package directly.

func RelativizePaths

func RelativizePaths(from, to string) (string, error)

RelativizePaths takes two absolute paths and returns a string that is the relative path from from to to.

Types

This section is empty.

Jump to

Keyboard shortcuts

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