GetOS
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
| Type | Description |
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.