mirror of
https://github.com/tests-always-included/mo.git
synced 2026-04-08 00:40:38 +02:00
Renaming variables
Ones that are all uppercase can conflict with system variables. Using lower case or camelCase variables will ensure we will never conflict with these predefined values.
This commit is contained in:
8
API.md
8
API.md
@@ -94,8 +94,8 @@ Examples
|
||||
callFunc () {
|
||||
local "$1" && moIndirect "$1" "the value"
|
||||
}
|
||||
callFunc DEST
|
||||
echo "$DEST" # writes "the value"
|
||||
callFunc dest
|
||||
echo "$dest" # writes "the value"
|
||||
|
||||
Returns nothing.
|
||||
|
||||
@@ -114,8 +114,8 @@ Examples
|
||||
local myArray=(one two three)
|
||||
local "$1" && moIndirectArray "$1" "${myArray[@]}"
|
||||
}
|
||||
callFunc DEST
|
||||
echo "${DEST[@]}" # writes "one two three"
|
||||
callFunc dest
|
||||
echo "${dest[@]}" # writes "one two three"
|
||||
|
||||
Returns nothing.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user