Skip to content

Commit 7b9940e

Browse files
committed
Fix linting issues: remove redundant build tags and use errors.New
Signed-off-by: Varun Gokulnath <[email protected]>
1 parent 1dafb01 commit 7b9940e

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

reparse.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//go:build windows
2-
// +build windows
32

43
package winio
54

65
import (
76
"bytes"
87
"encoding/binary"
8+
"errors"
99
"fmt"
1010
"strings"
1111
"unicode/utf16"
@@ -61,7 +61,7 @@ func DecodeReparsePointData(tag uint32, b []byte) (*ReparsePoint, error) {
6161
case reparseTagLxSymlink:
6262
// LX symlinks store the target as UTF-8 after a 4-byte version field
6363
if len(b) < 4 {
64-
return nil, fmt.Errorf("LX symlink buffer too short")
64+
return nil, errors.New("LX symlink buffer too short")
6565
}
6666
targetBytes := b[4:]
6767
for i, c := range targetBytes {

reparse_lx_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//go:build windows
2-
// +build windows
32

43
package winio
54

@@ -10,14 +9,14 @@ import (
109
func TestLxSymlinkRoundTrip(t *testing.T) {
1110
// Test LX symlink encode/decode
1211
original := &ReparsePoint{
13-
Target: "/usr/bin/bash",
12+
Target: "/usr/bin/bash",
1413
IsMountPoint: false,
1514
IsLxSymlink: true,
1615
}
1716

1817
// Encode
1918
encoded := EncodeReparsePoint(original)
20-
19+
2120
// Decode
2221
decoded, err := DecodeReparsePoint(encoded)
2322
if err != nil {
@@ -39,14 +38,14 @@ func TestLxSymlinkRoundTrip(t *testing.T) {
3938
func TestWindowsSymlinkNotLx(t *testing.T) {
4039
// Test that regular Windows symlinks are not marked as LX
4140
original := &ReparsePoint{
42-
Target: `C:\Windows\System32`,
41+
Target: `C:\Windows\System32`,
4342
IsMountPoint: false,
4443
IsLxSymlink: false,
4544
}
4645

4746
// Encode
4847
encoded := EncodeReparsePoint(original)
49-
48+
5049
// Decode
5150
decoded, err := DecodeReparsePoint(encoded)
5251
if err != nil {

0 commit comments

Comments
 (0)