package util import ( "fmt" "github.com/elastic/go-elasticsearch/v7/esapi" ) func CheckES7Response(result *esapi.Response) error { if result.StatusCode != 200 { return fmt.Errorf("status=%s msg=%s", result.StatusCode, result.String()) } return nil }