If it holds water...
Fencing for goats is perhaps more of a challenge than for other species of livestock, and more so for some goat breeds than others. Curiosity and the ability to climb and jump make traditional fences woefully ineffective at keeping adventurous members of the herd within the confines of their yard or field. This same sense of adventure also makes barbed wire an extremely dangerous fencing material for goats, particularly milking does.
Fencing for goats comes in many forms. Plank fences are quite popular, as are electric fences; both are quite successful if spacing is correct. Woven wire fencing (chicken wire, page wire, field fencing, hog fencing, etc.) is not generally recommended as sagging of the fence wires soon results if the goats stand on the fence.
Whatever material is chosen, the fence should be three to five feet high, depending on breed. Posts should be well-driven into the ground, and care should be taken that no sharp wires, nails, etc. are left protruding from any part of the fence structure.
Gates should be made with the same requirements for strength and security as the fence. Goats are famous for their ability to unlatch fasteners. Ideally, a second latch towards the bottom of the gate, where the goat cannot reach it, should be installed.