Godwin was commissioned as an Ensign into the 9th Foot on 30 October 1799. He served with the regiment at Ferrol in 1800 and was promoted Lieutenant on 9 August 1803. In an expedition to Hanover in 1805 he served as adjutant of his battalion. In 1808, at the outset of the Peninsular War, Godwin was in Portugal and was promoted Captain on 28 March 1808. The next year he took part in operations on the Douro and in the advance to Porto, then marched with his battalion to Gibraltar and later to Tarifa. He volunteered to follow Blayney in an attack on Fuengirola and later commanded two companies at the Siege of Cadiz. He fought at the defence of Tarifa in 1811, was severely wounded at the Battle of Barrosa on 5 March 1811, and ended the war as a brevet Major and a Companion of the Order of the Bath.
In 1814 Godwin received a Major's commission in the 5th West India Regiment. On 26 July 1821 he took up an appointment as Lieutenant-Colonel of the 41st Foot. In 1822 he led the regiment to India and in 1824 took it into Burma. In the second half of 1824 he was part of an expeditionary force which conquered Martaban, and following that Godwin saw active service in all battles of the First Anglo-Burmese War up to the Treaty of Yandaboo of 1826. In 1827 he was transferred to half pay. In 1837 was promoted Colonel and on 9 November 1846 Major General.
Godwin joined the General Staff of the Bombay Army in 1850, and with effect from November 1851 he took command of the army's Sirhind Division. In 1852, during the Second Anglo-Burmese War, Godwin was commander in chief of the British expeditionary force into Burma, known as the "Army of Ava", as well as commanding the force's Bengal Division.
Godwin, with his expeditionary force, set sail from Bombay on 28 March 1852, aiming for the mouth of the Irrawaddy River, where he was to be joined by forces sent from Madras. There, he found a naval force led by Admiral Austen on board HMS Rattler, with ships of both the Royal Navy and the Indian Navy. On 5 April 1852 the naval forces began to bombard Martaban. Godwin moved to capture Rangoon the same month.
On 12 April 1852, after a further naval bombardment, Godwin went ashore at Rangoon, leading a force comprising the 51st Light Infantry, the 18th Royal Irish, the 40th Bengal Native Infantry, and some artillery. Fighting continued until the 14th, when the capture of Rangoon was completed with the storming of the Great Dagon Pagoda.
On 21 November 1852, Godwin captured Pegu, with a force numbering four thousand men. He wrote the next day to the secretary of Lord Dalhousie, Governor General of India,
I have the honour to state, for the information of the Gov.-Gen. in Council, that Pegu was captured yesterday. In June last I was induced, by strong representations from various sources, to send a small force to drive out some Burmese from Pegu... The Burmese were driven out, and the people recovered possession of their town, but as I feared they did not hold it a week. As the army will shortly be at Prome, with a garrison only at Rangoon, it became imperative to take possession of and garrison Pegu.
In December 1852 Dalhousie proclaimed the annexation of the province of Pegu to British India. After more fighting at Prome and elsewhere, the Army of Ava was broken up on 1 July 1853 and Godwin returned to India.
On his arrival in India, Godwin again took up command of the Bengal Army's Sirhind Division. However, on 26 October 1853, after a brief illness, he died at Simla, while staying with Sir William Gomm, the Commander-in-Chief, India, with whom he had served in the 9th Foot. An obituary in The Gentleman's Magazine stated that "it was by overheating himself with exercise that his fatal malady was originated". After Godwin's death, news came from London that he had been appointed a Knight Commander of the Order of the Bath and as Colonel of the 20th Foot.
Godwin was married with one daughter, Maria Elizabeth, who was his heiress. She was interested in natural history and was a good musician and amateur artist. In 1833, at Teignmouth, Maria Elizabeth married the geologist Robert Austen. In 1854, by the royal licence of Queen Victoria, Austen took the surname of Godwin-Austen.
Maria Elizabeth's eldest son, Henry Haversham Godwin-Austen, retired from the army as a Lieutenant-Colonel in 1877 after service on the Trigonometrical Survey of India and was a notable geologist. Another of her sons, A. G. Godwin-Austen, also followed his grandfather into the army and retired as a Lieutenant Colonel, while his son Sir Alfred Godwin-Austen (1889-1963) became a full General.