response, err = client.Do(request)
if response.StatusCode != http.StatusOK {
log.Errorf("http request to online-gateway statusCode is %d", response.StatusCode)
return nil
}
respBody, err := ioutil.ReadAll(response.Body)
// 对返回的报文使用正则表达式处理
reg, _ := regexp.Compile("\\d{6,}")
respBodyDesensitization := reg.ReplaceAll(respBody, []byte("*****"))
正则表达式的语法和实例见https://blog.csdn.net/chushoufengli/article/details/89762893