aboutsummaryrefslogtreecommitdiff
path: root/forged/internal/common/misc/unsafe.go
diff options
context:
space:
mode:
Diffstat (limited to 'forged/internal/common/misc/unsafe.go')
-rw-r--r--forged/internal/common/misc/unsafe.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/forged/internal/common/misc/unsafe.go b/forged/internal/common/misc/unsafe.go
index 6c2192f..d827e7f 100644
--- a/forged/internal/common/misc/unsafe.go
+++ b/forged/internal/common/misc/unsafe.go
@@ -9,12 +9,12 @@ import "unsafe"
// Memory is borrowed from the string.
// The resulting byte slice must not be modified in any form.
func StringToBytes(s string) (bytes []byte) {
- return unsafe.Slice(unsafe.StringData(s), len(s))
+ return unsafe.Slice(unsafe.StringData(s), len(s)) //#nosec G103
}
// BytesToString converts a byte slice to a string without copying the bytes.
// Memory is borrowed from the byte slice.
// The source byte slice must not be modified.
func BytesToString(b []byte) string {
- return unsafe.String(unsafe.SliceData(b), len(b))
+ return unsafe.String(unsafe.SliceData(b), len(b)) //#nosec G103
}