First attested in the 1890s, US military slang in reference to Filipinos (in particular, it is defined in an 1893 citation in Slang and Its Analogues as referring to prostitutes who followed army camps; it is defined similarly in a 1914 work). The word was used for Nicaraguans during the US military occupation there in the 1910s, and for Haitians during the US invasion there, when Herbert Seligman noted in 1920 that "The Haitians … are nicknamed 'Gooks'". Other early uses in the 1920 and 30s still refer to people from the Philippines (a 1921 work refers to the Philippines as "Gook Land"), and the term also resembles goo-goo (“a Filipino person”), for which a variety of etymologies have been proposed; see that entry for more. (A later folk etymology suggests that during the Korean War, North Korean soldiers would shout Korean 美國 (Miguk, “America”) at Americans, who interpreted it as "me gook", as if identifying themselves as "gooks"; this ignores the many earlier examples of the word outside Korea.) Gook was used of Pacific Islanders by World War II, and Koreans and Vietnamese people by the time of the 1950s and 60s US military interventions there, which cemented the shift to meaning "Asian".
A few days later he had a 'damned good party' at NORMASH, drinking brandy, and he then 'beat up a Gook [Korean] village.' This resulted in an 'awful hangover all day', […] Later, he walked back to his unit, alone at three o'clock in the morning, having 'swiped a Gook torch.'2002, Colin Baker, Wild Goose: The Life and Death of Hugh Van Oppen, pages 59–60:
Of course, I've got so many confirmed kills I lost count. Nobody believes me because the gooks drag off their dead.1979, Gustav Hasford, The Short-Timers, New York: Bantam Books, published 1980, →ISBN, page 57:
3
Dated, Derogatory A foreigner (to the speaker), especially the (enemy) natives of a place the speaker's military is at war with or in.
"Haiti is a country with a history, […]" "but how about the Marines, and the gendarmerie; aren't they on the job?" […] "You know darn well a civilian can't get away with handling a gook like a Marine can; […]"1924 September 30, John Webb, “Henri II”, in Adventure, volume 48, number 6, page 101:
In scenes [in Flight, 1929] based on the Marines' slaughter of several hundred Nicaraguan rebels at the Battle of Ocotal in July 1927, the two heroes, who are rivals for the hand of a vivacious nurse (Lila Lee), repeatedly attack the "gooks" in support of their comrades on the ground.1999, M. Paul Holsinger, War and American Popular Culture: A Historical Encyclopedia, Greenwood Publishing Group, →ISBN, page 204:
4
Rhodesia, Dated, Derogatory A black insurgent in the Rhodesian Bush War.
"But shit, man, don't we do a fucking good job of it. Jesus, we slew long gooks this last trip," quipped Mark.1997, Dick Gledhill, One Commando: Rhodesia's Last Years & the Guerilla^([sic]) War It Never Lost, page 55:
Etymology From the manner whereby a small child, still developing its speech, would mispronounce /l/ (spoken with the tip of the tongue behind the teeth) as /ɡ/ (spoken with the back of the tongue on the palate), which happens if one tries to say look without moving the tongue forward, thus requiring less effort to speak. Compare also wook and wike for “look” and “like”, in which cases the tongue is stationary and only the lips move.
"Roost No More" was a yellow gook that Joe's people would spread around, for a fee, on the ledges of houses and commercial buildings plagued by pigeons.1983, Len O'Connor, A Reporter in Sweet Chicago, →ISBN, page 351:
Some say 'Mar Teazer do live in pattens and gook; must go to bed in 'em I'm thinking!1893, Dolly Pentreath, In a Cornish Township with Old Vogue Folk, page 26: