Magnetic fields and flows in coronal structures, for example, in gradual phases in flares, can be described by 2D and 3D magnetohydrostatic (MHS) and steady magnetohydrodynamic (MHD) equilibria. Within a physically simplified, but exact mathematical model, we study the electric currents and corresponding electric fields generated by shear flows. Starting from exact and analytically calculated magnetic potential fields, we solveid the nonlinear MHD equations self-consistently. By applying a magnetic shear flow and assuming a nonideal MHD environment, we calculated an electric field via Faraday's law. The formal solution for the electromagnetic field allowed us to compute an expression of an effective resistivity similar to the collisionless Speiser resistivity. We find that the electric field can be highly spatially structured, or in other words, filamented. The electric field component parallel to the magnetic field is the dominant component and is high where the resistivity has a maximum. The electric field is a potential field, therefore, the highest energy gain of the particles can be directly derived from the corresponding voltage. In our example of a coronal post-flare scenario we obtain electron energies of tens of keV, which are on the same order of magnitude as found observationally. This energy serves as a source for heating and acceleration of particles.