ax(node): replace prose comment with usage example on createTarball
AX Principle 2 — comments show HOW with real values, not WHAT the signature already says. The previous comment restated the function signature in prose; replaced with a concrete call showing filename/ content pairs. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
b55b2dd945
commit
22b6e8ace6
1 changed files with 2 additions and 1 deletions
|
|
@ -206,7 +206,8 @@ func isJSON(data []byte) bool {
|
|||
return data[0] == '{' || data[0] == '['
|
||||
}
|
||||
|
||||
// createTarball creates a tar archive from a map of filename -> content.
|
||||
// tarData, err := createTarball(map[string][]byte{"xmrig": binaryData, "config.json": cfgData})
|
||||
// if err != nil { return nil, err }
|
||||
func createTarball(files map[string][]byte) ([]byte, error) {
|
||||
var buffer bytes.Buffer
|
||||
tarWriter := tar.NewWriter(&buffer)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue