Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var InvalidContent = map[string]string{
"json": `{"bad": }`,
"yaml": "a: b\nc: d:::::::::::::::\n",
"toml": "key = 123__456\n",
"csv": "This string has a \\\" in it",
}
View Source
var ValidContent = map[string]string{
"json": `{"key": "value"}`,
"yaml": "key: value\n",
"yml": "key: value\n",
"toml": "key = \"value\"\n",
"csv": "a,b,c\n1,2,3\n",
"ini": "[section]\nkey=value\n",
"env": "KEY=VALUE\n",
"hcl": "key = \"value\"\n",
"xml": "<root><key>value</key></root>",
"properties": "key=value\n",
"hocon": "key = value\n",
"editorconfig": "root = true\n",
"plist": `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict><key>k</key><string>v</string></dict></plist>`,
"sarif": `{
"version": "2.1.0",
"$schema": "https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json",
"runs": [{"tool": {"driver": {"name": "test", "language": "en"}}, "results": [], "language": "en", "newlineSequences": ["\n"]}]
}`,
}
Minimal valid content for each file type
Functions ¶
func CreateFixtureDir ¶
CreateFixtureDir creates a temp directory with valid config files for the given extensions. Returns the path to the temp directory.
func CreateFixtureFile ¶
CreateFixtureFile creates a single temp file with the given extension and valid content. Returns the path to the file.
func CreateSubdir ¶
CreateSubdir creates a subdirectory under dir and returns its path.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.