mirror of
https://github.com/Icinga/icingabeat.git
synced 2025-08-15 14:58:08 +02:00
14 lines
513 B
Go
14 lines
513 B
Go
package common
|
|
|
|
// NetString store the byte length of the data that follows, making it easier
|
|
// to unambiguously pass text and byte data between programs that could be
|
|
// sensitive to values that could be interpreted as delimiters or terminators
|
|
// (such as a null character).
|
|
type NetString []byte
|
|
|
|
// MarshalText exists to implement encoding.TextMarshaller interface to
|
|
// treat []byte as raw string by other encoders/serializers (e.g. JSON)
|
|
func (n NetString) MarshalText() ([]byte, error) {
|
|
return n, nil
|
|
}
|