boundary.go
func (b *boundaryReader) isDelimiter(buf []byte) bool {
	idx := bytes.Index(buf, b.prefix)
	if idx == -1 {
		return false
	}

	// Fast forward to the end of the boundary prefix
	buf = buf[idx+len(b.prefix):]
	buf = bytes.TrimLeft(buf, " \t")
	if len(buf) > 0 {
		if buf[0] == '\r' || buf[0] == '\n' {
			return true
		}
	}

	return false
}
func (b *boundaryReader) isDelimiter(buf []byte) bool {
	idx := bytes.Index(buf, b.prefix)
	if idx == -1 {
		return false
	}

	// Fast forward to the end of the boundary prefix
	buf = buf[idx+len(b.prefix):]
	buf = bytes.TrimLeft(buf, " \t")
	if len(buf) > 0 {
		if buf[0] == '\r' || buf[0] == '\n' {
			return true
		}
	}

	return false
}
// isDelimiter returns true for --BOUNDARY\r\n but not --BOUNDARY--