mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-11-04 00:22:26 -06:00 
			
		
		
		
	* start fixing up tests * fix up tests + automate with drone * fiddle with linting * messing about with drone.yml * some more fiddling * hmmm * add cache * add vendor directory * verbose * ci updates * update some little things * update sig
		
			
				
	
	
		
			24 lines
		
	
	
	
		
			395 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
	
		
			395 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package sse
 | 
						|
 | 
						|
import "io"
 | 
						|
 | 
						|
type stringWriter interface {
 | 
						|
	io.Writer
 | 
						|
	WriteString(string) (int, error)
 | 
						|
}
 | 
						|
 | 
						|
type stringWrapper struct {
 | 
						|
	io.Writer
 | 
						|
}
 | 
						|
 | 
						|
func (w stringWrapper) WriteString(str string) (int, error) {
 | 
						|
	return w.Writer.Write([]byte(str))
 | 
						|
}
 | 
						|
 | 
						|
func checkWriter(writer io.Writer) stringWriter {
 | 
						|
	if w, ok := writer.(stringWriter); ok {
 | 
						|
		return w
 | 
						|
	} else {
 | 
						|
		return stringWrapper{writer}
 | 
						|
	}
 | 
						|
}
 |