diff --git a/reparse.go b/reparse.go index c949e3f..da8f450 100644 --- a/reparse.go +++ b/reparse.go @@ -1,11 +1,11 @@ //go:build windows -// +build windows package winio import ( "bytes" "encoding/binary" + "errors" "fmt" "strings" "unicode/utf16" @@ -61,7 +61,7 @@ func DecodeReparsePointData(tag uint32, b []byte) (*ReparsePoint, error) { case reparseTagLxSymlink: // LX symlinks store the target as UTF-8 after a 4-byte version field if len(b) < 4 { - return nil, fmt.Errorf("LX symlink buffer too short") + return nil, errors.New("LX symlink buffer too short") } targetBytes := b[4:] for i, c := range targetBytes { diff --git a/reparse_lx_test.go b/reparse_lx_test.go index 135fcde..d4a5f14 100644 --- a/reparse_lx_test.go +++ b/reparse_lx_test.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package winio @@ -10,14 +9,14 @@ import ( func TestLxSymlinkRoundTrip(t *testing.T) { // Test LX symlink encode/decode original := &ReparsePoint{ - Target: "/usr/bin/bash", + Target: "/usr/bin/bash", IsMountPoint: false, IsLxSymlink: true, } // Encode encoded := EncodeReparsePoint(original) - + // Decode decoded, err := DecodeReparsePoint(encoded) if err != nil { @@ -39,14 +38,14 @@ func TestLxSymlinkRoundTrip(t *testing.T) { func TestWindowsSymlinkNotLx(t *testing.T) { // Test that regular Windows symlinks are not marked as LX original := &ReparsePoint{ - Target: `C:\Windows\System32`, + Target: `C:\Windows\System32`, IsMountPoint: false, IsLxSymlink: false, } // Encode encoded := EncodeReparsePoint(original) - + // Decode decoded, err := DecodeReparsePoint(encoded) if err != nil {