High-resolution electron energy-loss spectroscopy in a transmission electron microscope is a very powerful method for the study of electronic structure of materials. The fine structure of Ga L2,3 and N ionization edges in c-GaN and h-GaN was studied using a TEM equipped with a monochromator and high-resolution energy spectrometer. The experimental results were compared with the results of calculation based on the density functional theory using the Wien2k code and show that the best fit is achieved when the core hole effect is taken into account. The effect of the core hole value and the supercell size on the energy-loss near-edge structure have been investigated. A different behaviour was found for c-GaN and h-GaN: better agreement is obtained for a 0.5 core hole for h-GaN and for a full core hole for c-GaN. The anisotropic behaviour of the experimental spectra and calculated spectra for h-GaN have been studied and the "magic" angle was determined.