universalpath

package module
v0.0.0-...-f30a6fc Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0

README

Universal Path Handling

This library provides functions to handle either Windows or Unix style paths, regardless of the operating system the code is running on.

The code for this is copied from the excellent Golang Standard Library's path/filepath package (which, unfortunately, is restricted via build tags to the native OS path style). We do not claim any ownership of this code. The patches directory contains the modifications made to the original code to make it work here.

There are two subpackages:

  • windows handles Windows style paths (e.g. C:\Program Files\app\file.txt)
  • unix handles Unix style paths (e.g. /usr/local/bin/app/file.txt)

The main package provides a Style type that can be set to either Windows or Unix and uses the appropriate subpackage to perform path operations.

Documentation

Index

Constants

View Source
const Native = Unix

Variables

This section is empty.

Functions

This section is empty.

Types

type Style

type Style int
const (
	Unix Style = iota
	Windows
)

func (Style) Base

func (p Style) Base(s string) string

func (Style) Clean

func (p Style) Clean(s string) string

func (Style) Dir

func (p Style) Dir(s string) string

func (Style) Ext

func (p Style) Ext(s string) string

func (Style) IsAbs

func (p Style) IsAbs(s string) bool

func (Style) Join

func (p Style) Join(s ...string) string

func (Style) Separator

func (p Style) Separator() string

func (Style) SeparatorByte

func (p Style) SeparatorByte() byte

func (Style) Split

func (p Style) Split(s string) (string, string)

func (Style) To

func (p Style) To(other Style, s string) string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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