The Euler equation for functionals with linear growth