github.com/lyraproj/hiera@v1.0.0-rc4/api/issues.go (about) 1 package api 2 3 import ( 4 "fmt" 5 ) 6 7 // JSONNOtHash creates an error with a descriptive text and returns it. 8 func JSONNOtHash(path string) error { 9 return fmt.Errorf(`file '%s' does not contain a JSON object`, path) 10 } 11 12 // MissingRequiredOption creates an error with a descriptive text and returns it. 13 func MissingRequiredOption(option string) error { 14 return fmt.Errorf(`missing required provider option '%s'`, option) 15 } 16 17 // MissingRequiredEnvironmentVariable creates an error with a descriptive text and returns it. 18 func MissingRequiredEnvironmentVariable(name string) error { 19 return fmt.Errorf(`missing required environment variable '%s'`, name) 20 } 21 22 // YamlNotHash creates an error with a descriptive text and returns it. 23 func YamlNotHash(path string) error { 24 return fmt.Errorf(`file '%s' does not contain a YAML hash`, path) 25 }