mirror of
https://github.com/rwinkhart/go-winio.git
synced 2026-09-06 00:57:19 -04:00
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:
committed by
Varun Gokulnath
parent
94113a48c2
commit
3ffe560692
+2
-2
@@ -1,11 +1,11 @@
|
|||||||
//go:build windows
|
//go:build windows
|
||||||
// +build windows
|
|
||||||
|
|
||||||
package winio
|
package winio
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
"unicode/utf16"
|
"unicode/utf16"
|
||||||
@@ -61,7 +61,7 @@ func DecodeReparsePointData(tag uint32, b []byte) (*ReparsePoint, error) {
|
|||||||
case reparseTagLxSymlink:
|
case reparseTagLxSymlink:
|
||||||
// LX symlinks store the target as UTF-8 after a 4-byte version field
|
// LX symlinks store the target as UTF-8 after a 4-byte version field
|
||||||
if len(b) < 4 {
|
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:]
|
targetBytes := b[4:]
|
||||||
for i, c := range targetBytes {
|
for i, c := range targetBytes {
|
||||||
|
|||||||
+2
-3
@@ -1,5 +1,4 @@
|
|||||||
//go:build windows
|
//go:build windows
|
||||||
// +build windows
|
|
||||||
|
|
||||||
package winio
|
package winio
|
||||||
|
|
||||||
@@ -10,7 +9,7 @@ import (
|
|||||||
func TestLxSymlinkRoundTrip(t *testing.T) {
|
func TestLxSymlinkRoundTrip(t *testing.T) {
|
||||||
// Test LX symlink encode/decode
|
// Test LX symlink encode/decode
|
||||||
original := &ReparsePoint{
|
original := &ReparsePoint{
|
||||||
Target: "/usr/bin/bash",
|
Target: "/usr/bin/bash",
|
||||||
IsMountPoint: false,
|
IsMountPoint: false,
|
||||||
IsLxSymlink: true,
|
IsLxSymlink: true,
|
||||||
}
|
}
|
||||||
@@ -39,7 +38,7 @@ func TestLxSymlinkRoundTrip(t *testing.T) {
|
|||||||
func TestWindowsSymlinkNotLx(t *testing.T) {
|
func TestWindowsSymlinkNotLx(t *testing.T) {
|
||||||
// Test that regular Windows symlinks are not marked as LX
|
// Test that regular Windows symlinks are not marked as LX
|
||||||
original := &ReparsePoint{
|
original := &ReparsePoint{
|
||||||
Target: `C:\Windows\System32`,
|
Target: `C:\Windows\System32`,
|
||||||
IsMountPoint: false,
|
IsMountPoint: false,
|
||||||
IsLxSymlink: false,
|
IsLxSymlink: false,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user