ax(node): replace prose comment with usage examples on isJSON
AX Principle 2: comments must show how to call the function, not restate what the type signature already says. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
e4144c5f48
commit
66d925ab56
1 changed files with 2 additions and 1 deletions
|
|
@ -196,7 +196,8 @@ func calculateChecksum(data []byte) string {
|
|||
return hex.EncodeToString(hash[:])
|
||||
}
|
||||
|
||||
// isJSON checks if data starts with JSON characters.
|
||||
// if isJSON(bundle.Data) { return bundle.Data, nil } // skip decrypt for plain profiles
|
||||
// if isJSON(content) { mode = 0644 } else { mode = 0755 } // executable unless JSON
|
||||
func isJSON(data []byte) bool {
|
||||
if len(data) == 0 {
|
||||
return false
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue