Fix linting issues: remove redundant build tags and use errors.New

Signed-off-by: Varun Gokulnath <vagokuln@microsoft.com>
Signed-off-by: Varun Gokulnath <gvarun22@outlook.com>
This commit is contained in:
Varun Gokulnath
2025-12-17 11:16:26 -08:00
committed by Varun Gokulnath
parent 94113a48c2
commit 3ffe560692
2 changed files with 6 additions and 7 deletions
+2 -2
View File
@@ -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 {
+4 -5
View File
@@ -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 {