Skip to content

Commit b67b593

Browse files
committed
fix: nil ptr
Hanchin Hsieh <[email protected]>
1 parent 64801d5 commit b67b593

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

bindings/go/util_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828

2929
func BytePtrFromString(s string) (*byte, error) {
3030
if s == "" {
31-
return nil, nil
31+
return new(byte), nil
3232
}
3333
return unix.BytePtrFromString(s)
3434
}

bindings/go/util_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727

2828
func BytePtrFromString(s string) (*byte, error) {
2929
if s == "" {
30-
return nil, nil
30+
return new(byte), nil
3131
}
3232
return windows.BytePtrFromString(s)
3333
}

0 commit comments

Comments
 (0)