mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 04:48:29 +08:00
fix: coding style and file format for all example.
This commit is contained in:
@@ -1,21 +1,21 @@
|
||||
// reboot.go
|
||||
// compile errors (Windows):
|
||||
//undefined: syscall.SYS_REBOOT
|
||||
// reboot.go:13: not enough arguments in call to syscall.Syscall
|
||||
// Linux: compileert, uitvoeren met sudo ./6.out --> systeem herstart
|
||||
package main
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
const LINUX_REBOOT_MAGIC1 uintptr = 0xfee1dead
|
||||
const LINUX_REBOOT_MAGIC2 uintptr = 672274793
|
||||
const LINUX_REBOOT_CMD_RESTART uintptr = 0x1234567
|
||||
|
||||
func main() {
|
||||
syscall.Syscall(syscall.SYS_REBOOT,
|
||||
LINUX_REBOOT_MAGIC1,
|
||||
LINUX_REBOOT_MAGIC2,
|
||||
LINUX_REBOOT_CMD_RESTART)
|
||||
}
|
||||
// reboot.go
|
||||
// compile errors (Windows):
|
||||
//undefined: syscall.SYS_REBOOT
|
||||
// reboot.go:13: not enough arguments in call to syscall.Syscall
|
||||
// Linux: compileert, uitvoeren met sudo ./6.out --> systeem herstart
|
||||
package main
|
||||
|
||||
import (
|
||||
"syscall"
|
||||
)
|
||||
|
||||
const LINUX_REBOOT_MAGIC1 uintptr = 0xfee1dead
|
||||
const LINUX_REBOOT_MAGIC2 uintptr = 672274793
|
||||
const LINUX_REBOOT_CMD_RESTART uintptr = 0x1234567
|
||||
|
||||
func main() {
|
||||
syscall.Syscall(syscall.SYS_REBOOT,
|
||||
LINUX_REBOOT_MAGIC1,
|
||||
LINUX_REBOOT_MAGIC2,
|
||||
LINUX_REBOOT_CMD_RESTART)
|
||||
}
|
||||
|
Reference in New Issue
Block a user