-// Copyright (c) 2018 Cisco and/or its affiliates.
+// Copyright (c) 2020 Cisco and/or its affiliates.
//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at:
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at:
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
-package main
+package binapigen
import (
"strings"
var commonInitialisms = map[string]bool{
"ACL": true,
"API": true,
- //"ASCII": true, // there are only two use cases for ASCII which already have initialism before and after
+ // NOTE: There are only two occurences of the word 'ascii' and
+ // these already have initialism before and after ASCII part,
+ // thus disabling initialism for this case.
+ "ASCII": false,
"CPU": true,
"CSS": true,
"DNS": true,
// specialInitialisms is a set of special initialisms that need part to stay in upper case.
var specialInitialisms = map[string]string{
"IPV": "IPv",
- //"IPV4": "IPv4",
- //"IPV6": "IPv6",
}
func usesInitialism(s string) string {