Type/to search
Built-in Functions
Global
Version
IsVirtual
GetOS
GetPid
GetMeta
Sleep
Unix
UnixNano
_D
GetCommand
GetLastError
SetErrorFilter
_N
_C
_Cross
JSON.parse
JSON.stringify
Encode
MD5
UUID
Log
Market
Trade
Account
Futures
Exchange
IO
Network
Storage
Threads
TA
Talib
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

Retrieves the operating system information of the device hosting the bot.

GetOS()

Examples

Print the OS and architecture of the docker's device.

javascript
function main() { Log(GetOS()) // Output: linux/amd64 (on a Linux x86-64 device) }
python
def main(): Log(GetOS()) # Output: linux/amd64 (on a Linux x86-64 device)
rust
fn main() { Log!(GetOS()); // Output: linux/amd64 (on a Linux x86-64 device) }

Returns

TypeDescription

string

Operating system information.

See Also

Remarks

For example, a bot running on the Mac OS operating system may return darwin/arm64 or darwin/amd64 when calling the GetOS() function. Since Apple computers use various hardware architectures, the return value includes the specific architecture information. Here, darwin is the kernel name of the Mac OS system. The return value has the form os/arch, matching Go's GOOS/GOARCH; for example, linux/amd64 on Linux and windows/amd64 on Windows.