// commit takes a line from the buffer and checks if it is a url. If it is,
// then it writes the URL using the message writer.
commit takes a line from the buffer and checks if it is a url. If it is,
then it writes the URL using the message writer.
// commit takes a line from the buffer and checks if it is a url . If it is // then it writes the URL using the message writer .
func (uw *URLWriter) commit() {
	line := strings.TrimSpace(uw.buffer.String())
	if strings.HasPrefix(line, "http") {
		_, err := url.Parse(line)
		if err == nil {
			uw.writer.Write([]byte("\r"))
			uw.writer.Write([]byte(uw.prefix))
			uw.writer.Write([]byte(line))
			uw.writer.Write([]byte("\n"))
		}
	}
	uw.buffer.Reset()
}
func ( uw * URLWriter ) commit ( ) { line := strings . TrimSpace ( uw . buffer . String ( ) ) if strings . HasPrefix ( line , " " ) { _ , err := url . Parse ( line ) if err == nil { uw . writer . Write ( [ ] byte ( " \r " ) ) uw . writer . Write ( [ ] byte ( uw . prefix ) ) uw . writer . Write ( [ ] byte ( line ) ) uw . writer . Write ( [ ] byte ( " \n " ) ) } } uw . buffer . Reset ( ) }
commit takes a line from the buffer and checks if it is a url.
commit takes a line from the buffer and checks if it is a url .
// Pull data from buffer, trim off spaces // Check if we have a URL, and if so print it // Clear the buffer regardless