handle errors from regexp.Compile
fixed go lint warnings