driveletter

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package driveletter implements utilities for working with unix drive letters. For a device file like /dev/sda, this would be the "a". Specifically, this helps deal with the fact that drive letters can actually be longer than one character. This is because once the letter "z" is used, the next letter will be "aa", so it works similarly to a numeric counting system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DriveLetter

type DriveLetter struct {
	// contains filtered or unexported fields
}

DriveLetter represents a unix drive letter. This is typically the last character in a device file like /dev/sda (though it can also be multiple characters).

func New

func New() *DriveLetter

New returns a new DriveLetter instance.

func (*DriveLetter) Inc

func (d *DriveLetter) Inc()

Inc increments the internal counter by one. Looking at the string representation, this would turn "a" into "b", "z" into "aa", and "az" into "ba", for example.

func (*DriveLetter) String

func (d *DriveLetter) String() string

String returns a string representation of the DriveLetter. This is basically similar to a transformation to base 26, using the letters of the alphabet as digits.

Jump to

Keyboard shortcuts

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