Export global.RootLength

This commit is contained in:
2025-12-06 12:54:07 -05:00
parent 95a877d0b3
commit ffae2e3002
4 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ type ByteInputFetcher func(prompt string) []byte
var ( var (
GetPassword ByteInputFetcher // Clients should set this to a function that fetches hidden input from the user GetPassword ByteInputFetcher // Clients should set this to a function that fetches hidden input from the user
rootLength = len(EntryRoot) // length of global.EntryRoot string RootLength = len(EntryRoot) // length of global.EntryRoot string
) )
const ( const (
+1 -1
View File
@@ -9,5 +9,5 @@ func GetRealPath(vanityPath string) string {
// GetVanityPath returns a vanityPath given a realPath // GetVanityPath returns a vanityPath given a realPath
func GetVanityPath(realPath string) string { func GetVanityPath(realPath string) string {
return realPath[rootLength:] return realPath[RootLength:]
} }
+1 -1
View File
@@ -13,5 +13,5 @@ func GetRealPath(vanityPath string) string {
// GetVanityPath returns a vanityPath given a realPath // GetVanityPath returns a vanityPath given a realPath
func GetVanityPath(realPath string) string { func GetVanityPath(realPath string) string {
return strings.ReplaceAll(realPath[rootLength:], "\\", "/") return strings.ReplaceAll(realPath[RootLength:], "\\", "/")
} }
+1 -1
View File
@@ -1,6 +1,6 @@
module github.com/rwinkhart/libmutton module github.com/rwinkhart/libmutton
go 1.25.4 go 1.25.5
require ( require (
github.com/pkg/sftp v1.13.10 github.com/pkg/sftp v1.13.10