(dateTime string)
| 60 | } |
| 61 | |
| 62 | func UpdateSystemTime(dateTime string) error { |
| 63 | system := runtime.GOOS |
| 64 | if system == "linux" { |
| 65 | cmdMgr := cmd.NewCommandMgr() |
| 66 | if err := cmdMgr.RunWithOptionalSudo("date", "-s", dateTime); err != nil { |
| 67 | return fmt.Errorf("update system time failed, %v", err) |
| 68 | } |
| 69 | return nil |
| 70 | } |
| 71 | return fmt.Errorf("the current system architecture %v does not support synchronization", system) |
| 72 | } |
| 73 | |
| 74 | func UpdateSystemTimeZone(timezone string) error { |
| 75 | system := runtime.GOOS |
nothing calls this directly
no test coverage detected