This commit is contained in:
amy 2024-07-14 06:19:21 +03:30
parent aff3757618
commit cc8322f221
9 changed files with 136 additions and 38 deletions

View file

@ -19,3 +19,11 @@ func ReadUntilNull(reader *bufio.Reader) ([]byte, error) {
}
return buf.Bytes(), nil
}
func ReadUntilNullString(reader *bufio.Reader) (string, error) {
buf, err := ReadUntilNull(reader)
if err != nil {
return "", err
}
return string(buf), nil
}