added handling of EOF errors
go fmt