diff --git a/website/data/checks.json b/website/data/checks.json index d74aca3f..dd67a641 100644 --- a/website/data/checks.json +++ b/website/data/checks.json @@ -1146,9 +1146,9 @@ }, "SA4008": { "Title": "The variable in the loop condition never changes, are you incrementing the wrong variable?", - "Text": "For example:\n\n\tfor i := 0; i \u003c 10; j++ { ... }\n\nThis may also occur when a loop condition does not have a chance to increment.\nFor example, when a loop body contains an unconditional panic:\n\n\tfunc f() {\n\t\tpanic(\"oops\")\n\t}\n\tfunc g() {\n\t\tfor i := 0; i \u003c 10; i++ {\n\t\t\t// f unconditionally calls panic, which means \"i\" is\n\t\t\t// never incremented.\n\t\t\tf()\n\t\t}\n\t}", + "Text": "For example:\n\n\tfor i := 0; i \u003c 10; j++ { ... }\n\nThis may also occur when a loop can only execute once because of unconditional\ncontrol flow that terminates the loop. For example, when a loop body contains an\nunconditional break, return, or panic:\n\n\tfunc f() {\n\t\tpanic(\"oops\")\n\t}\n\tfunc g() {\n\t\tfor i := 0; i \u003c 10; i++ {\n\t\t\t// f unconditionally calls panic, which means \"i\" is\n\t\t\t// never incremented.\n\t\t\tf()\n\t\t}\n\t}", "TitleMarkdown": "The variable in the loop condition never changes, are you incrementing the wrong variable?", - "TextMarkdown": "For example:\n\n\tfor i := 0; i \u003c 10; j++ { ... }\n\nThis may also occur when a loop condition does not have a chance to increment.\nFor example, when a loop body contains an unconditional panic:\n\n\tfunc f() {\n\t\tpanic(\"oops\")\n\t}\n\tfunc g() {\n\t\tfor i := 0; i \u003c 10; i++ {\n\t\t\t// f unconditionally calls panic, which means \"i\" is\n\t\t\t// never incremented.\n\t\t\tf()\n\t\t}\n\t}", + "TextMarkdown": "For example:\n\n\tfor i := 0; i \u003c 10; j++ { ... }\n\nThis may also occur when a loop can only execute once because of unconditional\ncontrol flow that terminates the loop. For example, when a loop body contains an\nunconditional break, return, or panic:\n\n\tfunc f() {\n\t\tpanic(\"oops\")\n\t}\n\tfunc g() {\n\t\tfor i := 0; i \u003c 10; i++ {\n\t\t\t// f unconditionally calls panic, which means \"i\" is\n\t\t\t// never incremented.\n\t\t\tf()\n\t\t}\n\t}", "Before": "", "After": "", "Since": "2017.1", @@ -1677,6 +1677,19 @@ "Severity": 3, "MergeIf": 0 }, + "SA6006": { + "Title": "Using io.WriteString to write []byte", + "Text": "Using io.WriteString to write a slice of bytes, as in\n\n```go\nio.WriteString(w, string(b))\n```\n\nis both unnecessary and inefficient. Converting from []byte to string\nhas to allocate and copy the data, and we could simply use w.Write(b)\ninstead.", + "TitleMarkdown": "Using io.WriteString to write `[]byte`", + "TextMarkdown": "Using io.WriteString to write a slice of bytes, as in\n\n```go\nio.WriteString(w, string(b))\n```\n\nis both unnecessary and inefficient. Converting from `[]byte` to `string`\nhas to allocate and copy the data, and we could simply use `w.Write(b)`\ninstead.", + "Before": "", + "After": "", + "Since": "Unreleased", + "NonDefault": false, + "Options": null, + "Severity": 0, + "MergeIf": 0 + }, "SA9001": { "Title": "Defers in range loops may not run when you expect them to", "Text": "", @@ -2166,7 +2179,8 @@ "SA6001", "SA6002", "SA6003", - "SA6005" + "SA6005", + "SA6006" ], "SA9": [ "SA9001",