| 1 |
//go:build purego || (!aix && !android && !darwin && !dragonfly && !freebsd && !illumos && !ios && !linux && !netbsd && !openbsd && !plan9 && !solaris) |
| 2 |
// +build purego !aix,!android,!darwin,!dragonfly,!freebsd,!illumos,!ios,!linux,!netbsd,!openbsd,!plan9,!solaris |
| 3 |
|
| 4 |
package buffer |
| 5 |
|
| 6 |
type Buffer []byte |
| 7 |
|
| 8 |
func New(n int) (Buffer, error) { |
| 9 |
return make([]byte, n), nil |
| 10 |
} |
| 11 |
|
| 12 |
func (a *Buffer) ProtectHead() []byte { |
| 13 |
return []byte(*a) |
| 14 |
} |
| 15 |
|
| 16 |
func (a *Buffer) ProtectTail() []byte { |
| 17 |
return []byte(*a) |
| 18 |
} |
| 19 |
|
| 20 |
func (a *Buffer) Release() { |
| 21 |
} |