The influence of nonuniform poloidal and toroidal background plasma flows on the spatial structure and growth rate of the electrostatic electron temperature gradient (ETG) mode is investigated in the linear approximation. This derivation includes the ballooning mode formalism and a more recently developed version of the direct method by Taylor and Wilson [Plasma Phys. Controlled Fusion 38, 1999 (1996)]. It is shown that the growth rate of the ETG mode is not changed significantly by flow shear. However, it is found that the spatial structure of the ETG mode depends crucially on the derivative of the flow shear rate with respect to the minor radius of the tokamak cross section and also depends crucially on the magnetic shear. For moderate magnetic shear, the unstable ETG mode is strongly localized in the poloidal direction and is elongated along the radial direction, with a characteristic radial width much larger than the electron Larmor radius. This may explain the formation of streamer structures above the threshold of ETG mode instability. Streamers are believed to enhance electron thermal transport beyond the values provided by simple mixing length estimates. For very low values of magnetic shear, the ETG mode structure becomes extended in the poloidal direction, and the ballooning formalism does not apply. In this case, the direct method is used and it is shown that the ETG mode is strongly localized in the radial direction. The small radial extent of these modes may considerably reduce electron heat transport, which would enhance the formation of an electron thermal transport barrier. © 2003 American Institute of Physics. [ABSTRACT FROM AUTHOR]