diff --git a/names/names.go b/names/names.go index 175060a..a1ea439 100644 --- a/names/names.go +++ b/names/names.go @@ -135,7 +135,7 @@ var ( {"Grpc", "GRPC", "grpc", nil}, {"Html", "HTML", "html", nil}, // Prevent HTTPSPort from becoming httpSPort - {"Http", "HTTP", "http", re2.MustCompile("HTTP(?!s|S)", re2.None)}, + {"Http", "HTTP", "http", re2.MustCompile("(HTTP((?!S[A-Z]))|Http(?!s))", re2.None)}, {"Https", "HTTPS", "https", nil}, {"Iam", "IAM", "iam", nil}, {"Icmp", "ICMP", "icmp", nil}, diff --git a/names/names_test.go b/names/names_test.go index 5cdb813..f8473e3 100644 --- a/names/names_test.go +++ b/names/names_test.go @@ -65,6 +65,16 @@ func TestNames(t *testing.T) { {"FifoTopic", "FIFOTopic", "fifoTopic", "fifo_topic", "fifotopic"}, {"HttpsPort", "HTTPSPort", "httpsPort", "https_port", "httpsport"}, {"HTTPSPort", "HTTPSPort", "httpsPort", "https_port", "httpsport"}, + {"HTTPPort", "HTTPPort", "httpPort", "http_port", "httpport"}, + {"HttpPort", "HTTPPort", "httpPort", "http_port", "httpport"}, + {"HttpError", "HTTPError", "httpError", "http_error", "httperror"}, + {"HTTPError", "HTTPError", "httpError", "http_error", "httperror"}, + {"HttpStatus", "HTTPStatus", "httpStatus", "http_status", "httpstatus"}, + {"HTTPStatus", "HTTPStatus", "httpStatus", "http_status", "httpstatus"}, + {"HTTPSSupport", "HTTPSSupport", "httpsSupport", "https_support", "httpssupport"}, + {"HttpsSupport", "HTTPSSupport", "httpsSupport", "https_support", "httpssupport"}, + {"HttpSupport", "HTTPSupport", "httpSupport", "http_support", "httpsupport"}, + {"HTTPSupport", "HTTPSupport", "httpSupport", "http_support", "httpsupport"}, {"Id", "ID", "id", "id", "id"}, {"ID", "ID", "id", "id", "id"}, {"Idle", "Idle", "idle", "idle", "idle"},