Many golf courses do have dress codes and you might not be allowed to play if you show up wearing something other than what the course calls proper attire.
Jayachamarajendra Wadiyar Golf Club
What is the Golf Dress Code? Here's What to Wear on the Course
What to Wear on the Golf Course
Dressing the Part - Is the Golf Dress Code Still Necessary
Women's Golf Dress Code: A Guide for Proper Ladies Golf Attire
Golf Etiquette - White Horse Golf Club
What Is The Golf Dress Code?
static./a/images/f_auto/dpr_3.0,cs_srgb/w_
Do Golf Courses Have Dress Codes? – Stitch Golf
Why do Golf Courses Require Collared Shirts?
No Jeans Allowed: The Golfer's Dress Code - The Left Rough
Golf Attire Etiquette - SportsRec