Skip to content

Avalanche-io/path

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

path

Package path implements a strongly typed path string. It enforces a forward slash ("/") separator, and and insures all paths end with a separator.

Example

package main

import (
    "fmt"

    "github.com/Avalanche-io/path"
)

func main() {
    p, err := path.New("/path/to/file.txt")
    if err != nil {
        panic(err)
    }
    fmt.Println(p) // "/path/to/"
    p, err = path.New("/path/to/dir/")
    if err != nil {
        panic(err)
    }
    fmt.Println(p) // "/path/to/dir/"
    p, err = path.New(".")
    if err != nil {
        panic(err)
    }
    fmt.Println(p) // "./"
}

License

This package is governed by the MIT License. See LICENSE file for details.

About

Simple path package for go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages