Lattice parameters of semiconductors depend on the concentration of free electrons via the deformation potentials of the occupied minima of the conduction bands. In the presented work we examined the lattice parameters of variously doped GaN samples (epitaxial layers on sapphire and on SiC, bulk crystals grown at high hydrostatic pressure and homoepitaxial layers). The following dopants were used: Si, Mg and O. The measurements were performed using high resolution X-ray diffractometry. The results indicate that free electrons expand the lattice what confirms a negative value of the deformation potential of the Γ minimum of the conduction band. However, for Mg-doping (acceptor) we observed the lattice expansion as well. This violates the Vegard's law, as Mg ions are smaller than Ga ions.