Because, ##F=ma=kv##, therefore, ##a=kv/m##. Clearly, the net acceleration ##A=-(g+a)##.
Also, ##A=dv/dt=-(g+ \frac {kv} m )##, so cross multiplying and integrating LHS with respect to ##v## and RHS with respect to ##t## gives me:
$$ v= e^{ \frac {-tk} m } * (u + \frac {gm} k) - \frac {gm} k $$...