http-boot-server/bootserver/bootprotocol/helpers.go
Melora Hugues 576c78e6dd
All checks were successful
continuous-integration/drone/push Build is passing
Add first version of protocol utilities
2023-07-29 12:04:44 +02:00

13 lines
286 B
Go

package bootprotocol
import "bytes"
var equalByte = []byte("=")
func splitKeyValue(param []byte) (key []byte, value []byte, err error) {
splitted := bytes.Split(param, equalByte)
if len(splitted) != 2 {
return nil, nil, ErrInvalidParam
}
return splitted[0], splitted[1], nil
}