mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: update to go 1.20 (#5968)
Co-authored-by: Colin Adler <colin1adler@gmail.com>
This commit is contained in:
co-authored by
Colin Adler
parent
4df1031f8b
commit
026b1cd2a4
@@ -110,11 +110,11 @@ func updateAuditDoc(doc []byte, auditableResourcesMap AuditableResourcesMap) ([]
|
||||
tableEndIndex := tableStartIndex + j
|
||||
|
||||
var buffer bytes.Buffer
|
||||
buffer.Write(doc[:tableStartIndex])
|
||||
buffer.WriteByte('\n')
|
||||
_, _ = buffer.Write(doc[:tableStartIndex])
|
||||
_ = buffer.WriteByte('\n')
|
||||
|
||||
buffer.WriteString("|<b>Resource<b>||\n")
|
||||
buffer.WriteString("|--|-----------------|\n")
|
||||
_, _ = buffer.WriteString("|<b>Resource<b>||\n")
|
||||
_, _ = buffer.WriteString("|--|-----------------|\n")
|
||||
|
||||
for _, resourceName := range sortedResourceNames {
|
||||
readableResourceName := resourceName
|
||||
@@ -131,21 +131,21 @@ func updateAuditDoc(doc []byte, auditableResourcesMap AuditableResourcesMap) ([]
|
||||
}
|
||||
auditActionsString := strings.Join(auditActions, ", ")
|
||||
|
||||
buffer.WriteString("|" + readableResourceName + "<br><i>" + auditActionsString + "</i>|<table><thead><tr><th>Field</th><th>Tracked</th></tr></thead><tbody>")
|
||||
_, _ = buffer.WriteString("|" + readableResourceName + "<br><i>" + auditActionsString + "</i>|<table><thead><tr><th>Field</th><th>Tracked</th></tr></thead><tbody>")
|
||||
|
||||
// We must sort the field names to ensure sub-table ordering
|
||||
sortedFieldNames := sortKeys(auditableResourcesMap[resourceName])
|
||||
|
||||
for _, fieldName := range sortedFieldNames {
|
||||
isTracked := auditableResourcesMap[resourceName][fieldName]
|
||||
buffer.WriteString("<tr><td>" + fieldName + "</td><td>" + strconv.FormatBool(isTracked) + "</td></tr>")
|
||||
_, _ = buffer.WriteString("<tr><td>" + fieldName + "</td><td>" + strconv.FormatBool(isTracked) + "</td></tr>")
|
||||
}
|
||||
|
||||
buffer.WriteString("</tbody></table>\n")
|
||||
_, _ = buffer.WriteString("</tbody></table>\n")
|
||||
}
|
||||
|
||||
buffer.WriteString("\n")
|
||||
buffer.Write(doc[tableEndIndex:])
|
||||
_, _ = buffer.WriteString("\n")
|
||||
_, _ = buffer.Write(doc[tableEndIndex:])
|
||||
return buffer.Bytes(), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user