MCPcopy
hub / github.com/hashicorp/hcl / keywordSuggestion

Function keywordSuggestion

json/didyoumean.go:15–17  ·  view source on GitHub ↗

keywordSuggestion tries to find a valid JSON keyword that is close to the given string and returns it if found. If no keyword is close enough, returns the empty string.

(given string)

Source from the content-addressed store, hash-verified

13// given string and returns it if found. If no keyword is close enough, returns
14// the empty string.
15func keywordSuggestion(given string) string {
16 return nameSuggestion(given, keywords)
17}
18
19// nameSuggestion tries to find a name from the given slice of suggested names
20// that is close to the given name and returns it if found. If no suggestion

Callers 2

parseKeywordFunction · 0.85
TestKeywordSuggestionFunction · 0.85

Calls 1

nameSuggestionFunction · 0.70

Tested by 1

TestKeywordSuggestionFunction · 0.68