mirror of
https://github.com/rwinkhart/go-boilerplate.git
synced 2026-08-27 20:36:29 -04:00
Avoid compiler optimizations breaking ZeroizeBytes
This commit is contained in:
@@ -2,6 +2,8 @@ package security
|
||||
|
||||
// ZeroizeBytes overwrites all
|
||||
// bytes in a slice with zeros.
|
||||
//
|
||||
//go:noinline
|
||||
func ZeroizeBytes(input []byte) {
|
||||
for i := range input {
|
||||
input[i] = 0
|
||||
|
||||
Reference in New Issue
Block a user