govalidator.MapData { username : []string{"regex:\\\S+"} } This rule is not throwing an error and accepts username with spaces in between.