Are you clear from where the electrons come?
And a reasonable Lewis structure invokes #2xxC=O# bonds, i.e. #:stackrel(ddot)O=C=stackrel(ddot)O:#, and that is 8 electron pairs which accounts for the valence electrons.....
I suppose we could draw resonance structures of #stackrel(+)O-=C-O^(-)# (which would still give rise to a linear structure), yet formal charges are generally discouraged in the presence of a resonance isomer that does NOT possess formal charge.
Compare the Lewis structure of #CO_2# to #CO#, where 10 valence electrons are distributed......
#""^(-):C-=O^+# is the Lewis structure I would draw, even tho this has formal charge, and an alternative structure of #:C=stackrel(ddot)O:# is possible. The former Lewis structure, with the formal charge assigned to carbon, nicely accounts for almost universal carbon ligation of #CO# when it acts as a ligand towards transition metals.